From 8e665a9a37b5273d47bc66ec76bb9c678489a91f Mon Sep 17 00:00:00 2001 From: francoispqt Date: Tue, 18 Jun 2019 12:16:14 +0800 Subject: [PATCH 1/2] linting return err directly --- parser/kpkeyval/kvparser.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/parser/kpkeyval/kvparser.go b/parser/kpkeyval/kvparser.go index 44c9e90c..2309013c 100644 --- a/parser/kpkeyval/kvparser.go +++ b/parser/kpkeyval/kvparser.go @@ -56,8 +56,5 @@ func (k *Parser) Parse(r io.Reader, cfg konfig.Values) error { } cfg.Set(cfgKey[0], strings.Join(cfgKey[1:], k.cfg.Sep)) } - if err := scanner.Err(); err != nil { - return err - } - return nil + return scanner.Err() } From b4ac065b0b3ada0e53f5828f5de381495106c97a Mon Sep 17 00:00:00 2001 From: francoispqt Date: Tue, 18 Jun 2019 12:18:27 +0800 Subject: [PATCH 2/2] misspell --- config.go | 2 +- watcher/kwfile/filewatcher.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 4e599c04..f7f8ce85 100644 --- a/config.go +++ b/config.go @@ -252,7 +252,7 @@ func (c *S) RegisterLoaderWatcher(lw LoaderWatcher, loaderHooks ...func(Store) e } // RegisterCloser adds a closer to the list of closers. -// Closers are closed when an error occured while reloading a config and the ExitOnError config is set to true +// Closers are closed when an error occurred while reloading a config and the ExitOnError config is set to true func RegisterCloser(closer io.Closer) Store { return instance().RegisterCloser(closer) } diff --git a/watcher/kwfile/filewatcher.go b/watcher/kwfile/filewatcher.go index 48726094..b69c04d6 100644 --- a/watcher/kwfile/filewatcher.go +++ b/watcher/kwfile/filewatcher.go @@ -17,7 +17,7 @@ var defaultRate = 10 * time.Second type Config struct { // Files is the path to the files to watch Files []string - // Rate is the rate at wich the file is watched + // Rate is the rate at which the file is watched Rate time.Duration // Debug sets the debug mode on the filewatcher Debug bool