@@ -143,6 +143,10 @@ type ParseErrorsAllowlist struct {
143143 UnknownFlags bool
144144}
145145
146+ // DEPRECATED: please use ParseErrorsAllowlist instead
147+ // This type will be removed in a future release
148+ type ParseErrorsWhitelist = ParseErrorsAllowlist
149+
146150// NormalizedName is a flag name that has been normalized according to rules
147151// for the FlagSet (e.g. making '-' and '_' equivalent).
148152type NormalizedName string
@@ -161,6 +165,10 @@ type FlagSet struct {
161165 // ParseErrorsAllowlist is used to configure an allowlist of errors
162166 ParseErrorsAllowlist ParseErrorsAllowlist
163167
168+ // DEPRECATED: please use ParseErrorsAllowlist instead
169+ // This field will be removed in a future release
170+ ParseErrorsWhitelist ParseErrorsAllowlist
171+
164172 name string
165173 parsed bool
166174 actual map [NormalizedName ]* Flag
@@ -984,6 +992,8 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
984992 case name == "help" :
985993 f .usage ()
986994 return a , ErrHelp
995+ case f .ParseErrorsWhitelist .UnknownFlags :
996+ fallthrough
987997 case f .ParseErrorsAllowlist .UnknownFlags :
988998 // --unknown=unknownval arg ...
989999 // we do not want to lose arg in this case
@@ -1042,6 +1052,8 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
10421052 f .usage ()
10431053 err = ErrHelp
10441054 return
1055+ case f .ParseErrorsWhitelist .UnknownFlags :
1056+ fallthrough
10451057 case f .ParseErrorsAllowlist .UnknownFlags :
10461058 // '-f=arg arg ...'
10471059 // we do not want to lose arg in this case
0 commit comments