mirror of
https://github.com/golang/go
synced 2024-11-25 05:57:57 -07:00
flag: fix format error in boolean error report. just use %q; the values are strings.
R=rsc CC=golang-dev https://golang.org/cl/3418043
This commit is contained in:
parent
730e39cd13
commit
e26f9b3420
@ -459,7 +459,7 @@ func (f *allFlags) parseOne(index int) (ok bool, next int) {
|
||||
if f, ok := flag.Value.(*boolValue); ok { // special case: doesn't need an arg
|
||||
if has_value {
|
||||
if !f.Set(value) {
|
||||
fmt.Fprintf(os.Stderr, "invalid boolean value %t for flag: -%s\n", value, name)
|
||||
fmt.Fprintf(os.Stderr, "invalid boolean value %q for flag: -%s\n", value, name)
|
||||
fail()
|
||||
}
|
||||
} else {
|
||||
@ -479,7 +479,7 @@ func (f *allFlags) parseOne(index int) (ok bool, next int) {
|
||||
}
|
||||
ok = flag.Value.Set(value)
|
||||
if !ok {
|
||||
fmt.Fprintf(os.Stderr, "invalid value %s for flag: -%s\n", value, name)
|
||||
fmt.Fprintf(os.Stderr, "invalid value %q for flag: -%s\n", value, name)
|
||||
fail()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user