From 5035ef04a02e6765b5038b270ce3c8050488972f Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Thu, 10 Apr 2025 06:22:01 +0300 Subject: [PATCH] flag: document CommandLine is the global FlagSet Not just defaults, but a state holder for the flag API. --- src/flag/flag.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/flag/flag.go b/src/flag/flag.go index 71902f7f5913e9..8f3d53312a060a 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -1193,9 +1193,8 @@ func Parsed() bool { return CommandLine.Parsed() } -// CommandLine is the default set of command-line flags, parsed from [os.Args]. -// The top-level functions such as [BoolVar], [Arg], and so on are wrappers for the -// methods of CommandLine. +// CommandLine holds [FlagSet] for global flags. Its methods are exposed +// as top-level functions such as [BoolVar], [Arg], and so on. var CommandLine *FlagSet func init() {