Skip to content

Commit

Permalink
Add mkdir error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
178inaba committed May 18, 2017
1 parent 8019ca9 commit 2b733d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ func getToken() (string, error) {
return "", err
}

os.MkdirAll(filepath.Dir(configFilePath), os.ModePerm)
if err := os.MkdirAll(filepath.Dir(configFilePath), os.ModePerm); err != nil {
return "", err
}

configFile, err := os.Create(configFilePath)
if err != nil {
return "", err
Expand Down

0 comments on commit 2b733d3

Please sign in to comment.