From 5b15941c61f478b8ed08b76a27186527ba73d273 Mon Sep 17 00:00:00 2001 From: yuz Date: Sun, 1 Mar 2020 21:35:56 +0900 Subject: [PATCH] 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 --- src/flag/flag.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flag/flag.go b/src/flag/flag.go index abf20b6240..eb88c1faa8 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -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() { -- 2.50.0