From 67864b2568b0d51f3970470f3292c7bdfaf31bee Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Mon, 13 May 2019 02:52:32 -0400 Subject: handling viper error when binding to pflags --- init.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.go b/init.go index bef94af..a4790d5 100644 --- a/init.go +++ b/init.go @@ -36,7 +36,9 @@ func init() { func initConfig() { pflag.Parse() - viper.BindPFlags(pflag.CommandLine) + if err := viper.BindPFlags(pflag.CommandLine); err != nil { + log.Printf("%v\n", err) + } viper.SetConfigName("getwtxt") viper.AddConfigPath(".") -- cgit 1.4.1-2-gfad0