From cd07b13a0b1d3c93554a553ec00a10b1fe4bd81e Mon Sep 17 00:00:00 2001 From: Wu22e Date: Mon, 31 Jul 2023 02:54:58 +0900 Subject: [PATCH] fix : add err check --- cmd/yorkie/commands.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/yorkie/commands.go b/cmd/yorkie/commands.go index 6adf3930f..857d44f47 100644 --- a/cmd/yorkie/commands.go +++ b/cmd/yorkie/commands.go @@ -18,6 +18,7 @@ package main import ( + "log" "os" "path" @@ -53,6 +54,10 @@ func init() { rootCmd.PersistentFlags().String("rpc-addr", "localhost:11101", "Address of the rpc server") rootCmd.PersistentFlags().Bool("insecure", false, "Skip the TLS connection of the client") - viper.BindPFlag("rpcAddr", rootCmd.PersistentFlags().Lookup("rpc-addr")) - viper.BindPFlag("isInsecure", rootCmd.PersistentFlags().Lookup("insecure")) + if err := viper.BindPFlag("rpcAddr", rootCmd.PersistentFlags().Lookup("rpc-addr")); err != nil { + log.Fatalf("Failed to bind rpcAddr flag: %v", err) + } + if err := viper.BindPFlag("isInsecure", rootCmd.PersistentFlags().Lookup("insecure")); err != nil { + log.Fatalf("Failed to bind isInsecure flag: %v", err) + } }