Skip to content

Commit

Permalink
flag: remove "// BUG" comment
Browse files Browse the repository at this point in the history
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: 26084698bfc0972d7e0fec0de4f31cc87e3a5f7a
GitHub-Pull-Request: golang/go#56210
Reviewed-on: https://go-review.googlesource.com/c/go/+/442815
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: David Chase <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
Reviewed-by: Rob Pike <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
zamicol authored and gopherbot committed Oct 17, 2022
1 parent 3d92205 commit 9abcc48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9abcc48

Please sign in to comment.