fix RegisterFlagCompletionFunc concurrent map writes error (#1423)
* fix-RegisterFlagCompletionFunc-concurrent * set to root command * move to non-public fields
This commit is contained in:
@ -142,6 +142,9 @@ type Command struct {
|
||||
// that we can use on every pflag set and children commands
|
||||
globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName
|
||||
|
||||
//flagCompletionFunctions is map of flag completion functions.
|
||||
flagCompletionFunctions map[*flag.Flag]func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective)
|
||||
|
||||
// usageFunc is usage func defined by user.
|
||||
usageFunc func(*Command) error
|
||||
// usageTemplate is usage template defined by user.
|
||||
|
Reference in New Issue
Block a user