diff --git a/src/flag/flag.go b/src/flag/flag.go index f6b38908f6d7e9..ef3cf29c0c5452 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -1056,9 +1056,9 @@ func (f *FlagSet) parseOne() (bool, error) { break } } - m := f.formal - flag, alreadythere := m[name] // BUG - if !alreadythere { + + flag, ok := f.formal[name] + if !ok { if name == "help" || name == "h" { // special case for nice help message. f.usage() return false, ErrHelp