Skip to content

Commit

Permalink
flag: clarify that a flag cannot be re-defined
Browse files Browse the repository at this point in the history
Fixes #31694

Change-Id: Ifb2ad2dc41c449668c0f6a4d4cfb9b583e5591f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/206126
Reviewed-by: Rob Pike <r@golang.org>
  • Loading branch information
agnivade committed Nov 11, 2019
1 parent a58a64d commit eae922f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ const (

// A FlagSet represents a set of defined flags. The zero value of a FlagSet
// has no name and has ContinueOnError error handling.
//
// Flag names must be unique within a FlagSet. An attempt to define a flag whose
// name is already in use will cause a panic.
type FlagSet struct {
// Usage is the function called when an error occurs while parsing flags.
// The field is a function (not a method) that may be changed to point to
Expand Down

0 comments on commit eae922f

Please sign in to comment.