summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-13 02:52:32 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-13 02:52:32 -0400
commit67864b2568b0d51f3970470f3292c7bdfaf31bee (patch)
treed8f58c2cdfe4677e440099ed90a0e057ba0d9ec4
parentd57295e38b8afd16982f3f6083122ab73f62ddf7 (diff)
downloadgetwtxt-67864b2568b0d51f3970470f3292c7bdfaf31bee.tar.gz
handling viper error when binding to pflags
-rw-r--r--init.go4
1 files changed, 3 insertions, 1 deletions
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(".")