]> Cypherpunks repositories - gostls13.git/commitdiff
flag: changed flag variable name in package doc, for clarity
authoryuz <re.yuz77777@gmail.com>
Sun, 1 Mar 2020 12:35:56 +0000 (21:35 +0900)
committerRob Pike <r@golang.org>
Tue, 3 Mar 2020 04:56:11 +0000 (04:56 +0000)
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>
src/flag/flag.go

index abf20b6240dc4190d37a75ed5b6affd9b050c995..eb88c1faa8b558d173ea3e026f4682d0e63834cd 100644 (file)
@@ -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() {