You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug. The flag package docs say that the form -flag x is only support for non-boolean flags.
The last form is not permitted for boolean flags because the meaning of the command
cmd -x *
will change if there is a file called 0, false, etc. You must use the -flag=false form to turn off a boolean flag.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.5 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/Yan/Documents/gopro"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.5/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.5/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/29/gt8kf375525g048cvqywvq1c0000gn/T/go-build990621475=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
What did you do?
https://play.golang.org/p/PIeoe178RG
What did you expect to see?
I expect the order of the bool and string flag argument to not matter
What did you see instead?
Putting the string arg before the bool var on the command line works but the other way does not.
The text was updated successfully, but these errors were encountered: