fix for parent context not setting child flags

main
Andrew Nicoll 3 years ago
parent d5833134fc
commit 2144cc5ad4

@ -145,7 +145,10 @@ func (f *Int64SliceFlag) Apply(set *flag.FlagSet) error {
// Int64Slice looks up the value of a local Int64SliceFlag, returns
// nil if not found
func (c *Context) Int64Slice(name string) []int64 {
return lookupInt64Slice(name, c.flagSet)
if fs := lookupFlagSet(name, c); fs != nil {
return lookupInt64Slice(name, fs)
}
return nil
}
func lookupInt64Slice(name string, set *flag.FlagSet) []int64 {

@ -157,7 +157,7 @@ func (f *IntSliceFlag) Apply(set *flag.FlagSet) error {
// nil if not found
func (c *Context) IntSlice(name string) []int {
if fs := lookupFlagSet(name, c); fs != nil {
return lookupIntSlice(name, c.flagSet)
return lookupIntSlice(name, fs)
}
return nil
}

Loading…
Cancel
Save