Skip to content

Commit

Permalink
Merge pull request #66 from ankushagarwal/master
Browse files Browse the repository at this point in the history
Bug fix: Create the directory first and then check using os.IsNotExist
  • Loading branch information
ankushagarwal authored Mar 8, 2017
2 parents a3b9f68 + 09d1113 commit 3bb383c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions cmd/cloud_sql_proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ func parseInstanceConfig(dir, instance string, cl *http.Client) (instanceConfig,
}
if strings.HasPrefix(strings.ToLower(in.DatabaseVersion), "postgres") {
path := filepath.Join(dir, instance)
if _, err := os.Stat(path); !os.IsNotExist(err) {
return instanceConfig{}, err
}
if err := os.MkdirAll(path, 0755); err != nil {
return instanceConfig{}, err
}
Expand Down

0 comments on commit 3bb383c

Please sign in to comment.