Apply all golangci-lint fixes

This commit is contained in:
Marc Di Luzio 2020-07-06 18:04:10 +01:00
parent 945b3299ac
commit 75910efbe5
8 changed files with 19 additions and 22 deletions

View file

@ -78,7 +78,9 @@ func LoadConfig() (config Config, err error) {
// Create the path if needed
path := filepath.Dir(datapath)
if _, err := os.Stat(path); os.IsNotExist(err) {
os.MkdirAll(path, os.ModePerm)
if err := os.MkdirAll(path, os.ModePerm); err != nil {
return Config{}, fmt.Errorf("Failed to create data path %s: %s", path, err)
}
} else {
// Read the file
_, err = os.Stat(datapath)