From e26f9b3420f0d54ed38c07039c898b099ae8db80 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 6 Dec 2010 14:23:52 -0500 Subject: [PATCH] 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 --- src/pkg/flag/flag.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/flag/flag.go b/src/pkg/flag/flag.go index 59c33403d3..e87f223964 100644 --- a/src/pkg/flag/flag.go +++ b/src/pkg/flag/flag.go @@ -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() } } -- 2.50.0