aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Johnson <[email protected]>2020-06-02 13:02:28 -0700
committerGitHub <[email protected]>2020-06-02 13:02:28 -0700
commitb41e8b71c79e468a4b241960c1ce469a1d762f73 (patch)
treeafeffad6f9786f4d27a824557d998388fcf0f393
parent81378bbcd8a1005f72b1e8d7579e5dd7b2d612ab (diff)
Switching from whitelist to Allowlist terminology
-rw-r--r--flag.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/flag.go b/flag.go
index 7c058de..a685e42 100644
--- a/flag.go
+++ b/flag.go
@@ -124,8 +124,8 @@ const (
PanicOnError
)
-// ParseErrorsWhitelist defines the parsing errors that can be ignored
-type ParseErrorsWhitelist struct {
+// ParseErrorsAllowlist defines the parsing errors that can be ignored
+type ParseErrorsAllowlist struct {
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
UnknownFlags bool
}
@@ -145,8 +145,8 @@ type FlagSet struct {
// help/usage messages.
SortFlags bool
- // ParseErrorsWhitelist is used to configure a whitelist of errors
- ParseErrorsWhitelist ParseErrorsWhitelist
+ // ParseErrorsAllowlist is used to configure an allowlist of errors
+ ParseErrorsAllowlist ParseErrorsAllowlist
name string
parsed bool
@@ -973,7 +973,7 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
case name == "help":
f.usage()
return a, ErrHelp
- case f.ParseErrorsWhitelist.UnknownFlags:
+ case f.ParseErrorsAllowlist.UnknownFlags:
// --unknown=unknownval arg ...
// we do not want to lose arg in this case
if len(split) >= 2 {
@@ -1028,7 +1028,7 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
f.usage()
err = ErrHelp
return
- case f.ParseErrorsWhitelist.UnknownFlags:
+ case f.ParseErrorsAllowlist.UnknownFlags:
// '-f=arg arg ...'
// we do not want to lose arg in this case
if len(shorthands) > 2 && shorthands[1] == '=' {