From a54593d7f3852a6cda3dc8311f53ba9bbe5adcdd Mon Sep 17 00:00:00 2001 From: Kyoichiro Yamada Date: Thu, 13 Apr 2017 21:54:13 +0900 Subject: [PATCH] fix lints: declaration of "err" shadows declaration at io.go:11 --- settings/io.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/settings/io.go b/settings/io.go index c479928..e3fc2c3 100644 --- a/settings/io.go +++ b/settings/io.go @@ -9,12 +9,12 @@ import ( // Stream return a byte stream of a given file func (s Settings) Stream(file string) ([]byte, error) { _, err := os.Stat(file) - if err == nil { - content, err := ioutil.ReadFile(file) - s.Validate(err) - return content, err + if err != nil { + return nil, err } - return nil, err + content, err := ioutil.ReadFile(file) + s.Validate(err) + return content, err } // Write a file given a name and a byte stream