Skip to content

Commit

Permalink
flag: changed flag variable name in package doc, for clarity
Browse files Browse the repository at this point in the history
Changed the flag variable name to nFlag instead of flagname,
because flagname was confusing.

Change-Id: I20dd4c4b4f605395d427a125ba4fd14580e5d766
Reviewed-on: https://go-review.googlesource.com/c/go/+/221678
Reviewed-by: Rob Pike <r@golang.org>
  • Loading branch information
yuzuy authored and erikwilson committed Jun 8, 2020
1 parent a11a5ee commit 8e74ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
Define flags using flag.String(), Bool(), Int(), etc.
This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
This declares an integer flag, -n, stored in the pointer nFlag, with type *int:
import "flag"
var ip = flag.Int("flagname", 1234, "help message for flagname")
var nFlag = flag.Int("n", 1234, "help message for flag n")
If you like, you can bind the flag to a variable using the Var() functions.
var flagvar int
func init() {
Expand Down

0 comments on commit 8e74ddd

Please sign in to comment.