From 837c029b163c4482085ba02dee62291d6c7384c2 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 13 Dec 2016 19:03:22 +0100 Subject: [PATCH] storage: Fix linter issue Go style tries to avoid indented `else` blocks. --- storage/local/persistence.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/storage/local/persistence.go b/storage/local/persistence.go index 82217531dd..3eaa4d32f4 100644 --- a/storage/local/persistence.go +++ b/storage/local/persistence.go @@ -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 {