Merge pull request #527 from urfave/dereference-flag-pointers
Dereference `Flag`s if they are pointers
This commit is contained in:
commit
bf7166a9d7
@ -79,7 +79,12 @@ func (c *Context) IsSet(name string) bool {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
envVarValue := reflect.ValueOf(f).FieldByName("EnvVar")
|
val := reflect.ValueOf(f)
|
||||||
|
if val.Kind() == reflect.Ptr {
|
||||||
|
val = val.Elem()
|
||||||
|
}
|
||||||
|
|
||||||
|
envVarValue := val.FieldByName("EnvVar")
|
||||||
if !envVarValue.IsValid() {
|
if !envVarValue.IsValid() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user