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

@@ -123,9 +123,9 @@ func (f *TimestampFlag) Apply(set *flag.FlagSet) error {
}
f.Value.SetLayout(f.Layout)
if val, ok, source := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok {
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
if err := f.Value.Set(val); err != nil {
return fmt.Errorf("could not parse %q as timestamp value %s for flag %s: %s", val, source, f.Name, err)
return fmt.Errorf("could not parse %q as timestamp value from %s for flag %s: %s", val, source, f.Name, err)
}
f.HasBeenSet = true
}