Skip to content

Commit

Permalink
fix : add err check
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu22e committed Jul 30, 2023
1 parent f46e05a commit cd07b13
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/yorkie/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package main

import (
"log"
"os"
"path"

Expand Down Expand Up @@ -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)
}
}

0 comments on commit cd07b13

Please sign in to comment.