Gerrit Bot has uploaded this change for review.
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: c41beab74af7d8aaf1eec18e01d3afcc22830411
GitHub-Pull-Request: golang/go#56210
---
M src/flag/flag.go
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/flag/flag.go b/src/flag/flag.go
index f6b3890..01dc38c 100644
--- a/src/flag/flag.go
+++ b/src/flag/flag.go
@@ -1056,9 +1056,9 @@
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
To view, visit change 442815. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 1:Run-TryBot +1Code-Review +2
1 comment:
File src/flag/flag.go:
Patch Set #1, Line 1060: flag, ok := f.formal[name]
Please remove the trailing whitespace (running gofmt should do that). Thanks.
To view, visit change 442815. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Rob Pike.
Gerrit Bot uploaded patch set #2 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Rob Pike, TryBot-Result+1 by Gopher Robot
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: 26084698bfc0972d7e0fec0de4f31cc87e3a5f7a
GitHub-Pull-Request: golang/go#56210
---
M src/flag/flag.go
1 file changed, 16 insertions(+), 3 deletions(-)
To view, visit change 442815. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Ian Lance Taylor, Rob Pike.
1 comment:
File src/flag/flag.go:
Patch Set #1, Line 1060: flag, ok := f.formal[name]
Please remove the trailing whitespace (running gofmt should do that). Thanks.
Done
To view, visit change 442815. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Rob Pike.
Patch set 2:Run-TryBot +1Auto-Submit +1Code-Review +2
1 comment:
Patchset:
Thanks.
To view, visit change 442815. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Rob Pike.
Patch set 2:Code-Review +1
Gopher Robot submitted this change.
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: 26084698bfc0972d7e0fec0de4f31cc87e3a5f7a
GitHub-Pull-Request: golang/go#56210
Reviewed-on: https://go-review.googlesource.com/c/go/+/442815
Reviewed-by: Ian Lance Taylor <ia...@google.com>
Reviewed-by: David Chase <drc...@google.com>
Auto-Submit: Ian Lance Taylor <ia...@google.com>
Run-TryBot: Ian Lance Taylor <ia...@google.com>
Reviewed-by: Rob Pike <r...@golang.org>
TryBot-Result: Gopher Robot <go...@golang.org>
---
M src/flag/flag.go
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/src/flag/flag.go b/src/flag/flag.go
index f6b3890..ef3cf29 100644
--- a/src/flag/flag.go
+++ b/src/flag/flag.go
@@ -1056,9 +1056,9 @@
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
To view, visit change 442815. To unsubscribe, or for help writing mail filters, visit settings.