fix panic getting visible flags
This commit is contained in:
parent
edb24d02aa
commit
f621deee5a
2
flag.go
2
flag.go
@ -512,7 +512,7 @@ func (f Float64Flag) GetName() string {
|
||||
func visibleFlags(fl []Flag) []Flag {
|
||||
visible := []Flag{}
|
||||
for _, flag := range fl {
|
||||
if !reflect.ValueOf(flag).FieldByName("Hidden").Bool() {
|
||||
if !reflect.Indirect(reflect.ValueOf(flag)).FieldByName("Hidden").Bool() {
|
||||
visible = append(visible, flag)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user