Merge pull request #2278 from prometheus/beorn7/style

storage: Fix linter issue
This commit is contained in:
Björn Rabenstein 2016-12-13 23:13:05 +01:00 committed by GitHub
commit a4c8292232
1 changed files with 2 additions and 3 deletions

View File

@ -154,11 +154,10 @@ func newPersistence(
// empty. If not, we have found an old storage directory without
// version file, so we have to bail out.
if err := os.MkdirAll(basePath, 0700); err != nil {
if abspath, e := filepath.Abs(basePath); e != nil {
return nil, fmt.Errorf("cannot create persistent directory %s: %s", basePath, err)
} else {
if abspath, e := filepath.Abs(basePath); e == nil {
return nil, fmt.Errorf("cannot create persistent directory %s: %s", abspath, err)
}
return nil, fmt.Errorf("cannot create persistent directory %s: %s", basePath, err)
}
fis, err := ioutil.ReadDir(basePath)
if err != nil {