Merge pull request #2579 from thaJeztah/fix_cfgfile_error

config: fix error message using incorrect filename
This commit is contained in:
Silvin Lubecki 2020-06-15 10:35:57 +02:00 committed by GitHub
commit c5c6fb1cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -117,11 +117,11 @@ func Load(configDir string) (*configfile.ConfigFile, error) {
if err != nil { if err != nil {
return configFile, errors.Wrap(err, oldConfigfile) return configFile, errors.Wrap(err, oldConfigfile)
} }
confFile := filepath.Join(homedir, oldConfigfile) filename = filepath.Join(homedir, oldConfigfile)
if _, err := os.Stat(confFile); err != nil { if _, err := os.Stat(filename); err != nil {
return configFile, nil // missing file is not an error return configFile, nil // missing file is not an error
} }
file, err := os.Open(confFile) file, err := os.Open(filename)
if err != nil { if err != nil {
return configFile, errors.Wrap(err, filename) return configFile, errors.Wrap(err, filename)
} }