You say that the first works as expected, but they both print "tstst=true".
This is because: "You must use the -flag=false form to turn off a boolean
flag" (https://golang.org/pkg/flag/).

Without the "=", it's ambiguous whether "-tst false" is enabling the flag,
followed by a non-flag argument "false," or disabling the flag.

On Tue, Feb 14, 2017 at 1:46 PM, Nico Ma <helloma...@gmail.com> wrote:

> Hi,
>
> First time poster here.
>
> I have found what I think is a bug. Compiling the program in
> https://play.golang.org/p/PIeoe178RG and running it with the string
> argument first works as expected but the other way does not.
> If I put the bool var before the string var then it always seem to result
> in the default value being used.
>
> I have reported it on github https://github.com/golang/go/issues/19091 I
> hope it was not premature.
>
> Thanks,
> Nico
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to