mirror of
https://github.com/golang/go
synced 2024-11-17 22:34:47 -07:00
flag: remove "// BUG" comment
Remove a vestigial " // BUG" comment as there is no bug in the relevant code section and comment predated other changes. Also removed a needless allocation and conformed to the "v, ok := a[x]" standard convention. Tests are passing.
Change-Id: Id28ad1baf77447052b54b341f018e573bac0c11a
GitHub-Last-Rev: 26084698bf
GitHub-Pull-Request: golang/go#56210
Reviewed-on: https://go-review.googlesource.com/c/go/+/442815
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
3d92205ef5
commit
9abcc487f8
@ -1056,9 +1056,9 @@ func (f *FlagSet) parseOne() (bool, error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m := f.formal
|
|
||||||
flag, alreadythere := m[name] // BUG
|
flag, ok := f.formal[name]
|
||||||
if !alreadythere {
|
if !ok {
|
||||||
if name == "help" || name == "h" { // special case for nice help message.
|
if name == "help" || name == "h" { // special case for nice help message.
|
||||||
f.usage()
|
f.usage()
|
||||||
return false, ErrHelp
|
return false, ErrHelp
|
||||||
|
Loading…
Reference in New Issue
Block a user