fix panic getting visible flags

This commit is contained in:
Joshua Rubin 2016-06-08 04:27:57 -06:00
parent edb24d02aa
commit f621deee5a
No known key found for this signature in database
GPG Key ID: 7E86D83E7AD27F82

View File

@ -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)
}
}