From f1e7ea30207e8c237d9d7c0111b56caea8f997cf Mon Sep 17 00:00:00 2001 From: ben-toogood Date: Mon, 24 Feb 2020 18:07:11 +0000 Subject: [PATCH] Handle non IsNotExist errors in config (#1251) Co-authored-by: Asim Aslam --- util/config/config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/config/config.go b/util/config/config.go index af4eae78..20f2bf10 100644 --- a/util/config/config.go +++ b/util/config/config.go @@ -53,6 +53,8 @@ func Set(key, value string) error { // write the file if it does not exist if _, err := os.Stat(fp); os.IsNotExist(err) { ioutil.WriteFile(fp, []byte{}, 0644) + } else if err != nil { + return err } // create a new config