mirror of
https://github.com/golang/go
synced 2024-11-22 04:14:42 -07:00
flag: fix bug in handling of booleans on error
Fixes #3869. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/6448072
This commit is contained in:
parent
88e858ac80
commit
48ca3f288c
@ -707,7 +707,7 @@ func (f *FlagSet) parseOne() (bool, error) {
|
||||
if fv, ok := flag.Value.(*boolValue); ok { // special case: doesn't need an arg
|
||||
if has_value {
|
||||
if err := fv.Set(value); err != nil {
|
||||
f.failf("invalid boolean value %q for -%s: %v", value, name, err)
|
||||
return false, f.failf("invalid boolean value %q for -%s: %v", value, name, err)
|
||||
}
|
||||
} else {
|
||||
fv.Set("true")
|
||||
|
Loading…
Reference in New Issue
Block a user