fixup! Report the source of a value when we cannot parse it

move bool to the end of the return arguments

remove "from " prefix in the source/fromWhere description

remove TODO notes from functions that don't currently perform error checking
This commit is contained in:
Mostyn Bramley-Moore
2020-11-07 14:05:37 +01:00
parent 500d6b04e6
commit cdc1f6e07c
16 changed files with 36 additions and 35 deletions

View File

@@ -57,8 +57,7 @@ func (f *StringFlag) GetValue() string {
// Apply populates the flag given the flag set and environment
func (f *StringFlag) Apply(set *flag.FlagSet) error {
// TODO: how to report source?
if val, ok, _ := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok {
if val, _, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
f.Value = val
f.HasBeenSet = true
}