From 9ad415e0b5ad4994f9e20397eec0c2a8944069d4 Mon Sep 17 00:00:00 2001 From: HuKeping Date: Wed, 2 Dec 2015 19:21:47 +0800 Subject: [PATCH] Tiny refactor It's no need to keep the `err` after asserting it should be `nil`, and we can merge these two logs into one I suppose. Signed-off-by: Hu Keping --- cmd/notary-signer/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/notary-signer/main.go b/cmd/notary-signer/main.go index 092dedd07a..91b66f72c1 100644 --- a/cmd/notary-signer/main.go +++ b/cmd/notary-signer/main.go @@ -195,10 +195,9 @@ func main() { mainViper.SetConfigType(strings.TrimPrefix(ext, ".")) mainViper.SetConfigName(strings.TrimSuffix(filename, ext)) mainViper.AddConfigPath(configPath) - err := mainViper.ReadInConfig() - if err != nil { - logrus.Error("Viper Error: ", err.Error()) - logrus.Error("Could not read config at ", configFile) + + if err := mainViper.ReadInConfig(); err != nil { + logrus.Errorf("Could not read config at :%s, viper error: %v", configFile, err) os.Exit(1) }