From 8e10e67b89257cb257e788919ac230b5707cf9d1 Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Tue, 12 Nov 2019 10:09:12 +0800 Subject: [PATCH] Fix: throw correct error in read config --- config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 3f4da5aa..1e5ab5fc 100644 --- a/config/config.go +++ b/config/config.go @@ -121,11 +121,11 @@ func readRawConfig(path string) ([]byte, error) { } path = path[:len(path)-5] + ".yml" - if _, err = os.Stat(path); err == nil { + if _, fallbackErr := os.Stat(path); fallbackErr == nil { return ioutil.ReadFile(path) } - return data, nil + return data, err } func readConfig(path string) (*rawConfig, error) {