1
0
mirror of https://github.com/golang/go synced 2024-09-29 23:14:29 -06:00

flag: changed flag variable name in package doc, for clarity

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>
This commit is contained in:
yuz 2020-03-01 21:35:56 +09:00 committed by Rob Pike
parent 972df38445
commit 5b15941c61

View 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() {