From 45b938ea42708d3f4b335643641a01ef296aa115 Mon Sep 17 00:00:00 2001 From: gVisor bot 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) {