]> Cypherpunks repositories - gostls13.git/commitdiff
flag: document use of FlagSet name parameter
authorIan Lance Taylor <iant@golang.org>
Wed, 28 Mar 2018 14:44:06 +0000 (07:44 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 28 Mar 2018 20:56:03 +0000 (20:56 +0000)
Fixes #24225

Change-Id: I876ac1b9d3615283f7b88cfa0b965ef81a57f056
Reviewed-on: https://go-review.googlesource.com/102955
Reviewed-by: Rob Pike <r@golang.org>
src/flag/flag.go

index edde5282cf444982699021c242dc0d8e339db60f..358402345cba92b839bdf314180c1a94971bb611 100644 (file)
@@ -981,7 +981,8 @@ func commandLineUsage() {
 }
 
 // NewFlagSet returns a new, empty flag set with the specified name and
-// error handling property.
+// error handling property. If the name is not empty, it will be printed
+// in the default usage message and in error messages.
 func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
        f := &FlagSet{
                name:          name,