diff options
Diffstat (limited to 'libgo/go/flag/flag.go')
-rw-r--r-- | libgo/go/flag/flag.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/flag/flag.go b/libgo/go/flag/flag.go index f0842a1..5444ad1 100644 --- a/libgo/go/flag/flag.go +++ b/libgo/go/flag/flag.go @@ -620,8 +620,9 @@ func (f *FlagSet) Var(value Value, name string, usage string) { flag := &Flag{name, usage, value, value.String()} _, alreadythere := f.formal[name] if alreadythere { - fmt.Fprintf(f.out(), "%s flag redefined: %s\n", f.name, name) - panic("flag redefinition") // Happens only if flags are declared with identical names + msg := fmt.Sprintf("%s flag redefined: %s", f.name, name) + fmt.Fprintln(f.out(), msg) + panic(msg) // Happens only if flags are declared with identical names } if f.formal == nil { f.formal = make(map[string]*Flag) |