New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2_bug_fixing_1121 : Now StringSliceFlag, Value(default) value set in Destination #1123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Can we add a test for that? |
Yes I will add a test. |
@saschagrunert and @rliebz , i added a test in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, @urfave/cli I think the CI is broken here but I'm not sure if it's related to this change 🤔
echoing my comment on #1127, this PR looks like it solves the same issue as that one. @sgoroshko & @atif-konasl can you both have a conversation about whose solution you think should move forward? We can't merge both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With respect to CI failing, @atif-konasl try removing the special characters from your branch name. That will require you to create a new PR, most likely. |
Motivation
Value(default) does not set in Destination field in StringSliceFlag.
Findings
set.StringVar(f.Destination, name, f.Value, f.Usage)
this type of method for slice of string in flag.go in flag package.Changes
When Destination field set as a StringSlice in StringSliceFlag then we need to set Value(StringSlice) in Destination as default. But flag.go in flag package does not support this.
For that reason we need to set Value in Destination before call
set.Var(f.Destination, name, f.Usage)
Before Change :
After Change :
Run go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/atif/.cache/go-build"
GOENV="/home/atif/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/atif/WorkStation/Lukso/CodeBase"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build805853841=/tmp/go-build -gno-record-gcc-switches"