Treat envars as higher priority than resolvers.

This commit is contained in:
Alec Thomas
2018-09-21 12:06:24 +10:00
parent 026359efd8
commit 3a832f8343
5 changed files with 28 additions and 52 deletions
+3
View File
@@ -198,6 +198,9 @@ func (c *Context) FlagValue(flag *Flag) interface{} {
return v.Interface()
}
}
if flag.Target.IsValid() {
return flag.Target.Interface()
}
return flag.DefaultValue.Interface()
}