Skip to content

Commit

Permalink
feat: gen kv conf (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifooth committed Dec 27, 2023
1 parent 93fd9c1 commit 78d6b08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/bscp/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func initBaseConf() (*config.ClientConfig, error) {
if configPath != "" {
v := viper.New()
v.SetConfigFile(configPath)
// 固定 yaml 格式
v.SetConfigType("yaml")
if err := v.ReadInConfig(); err != nil {
return nil, fmt.Errorf("read config file failed, err: %s", err.Error())
}
Expand Down Expand Up @@ -140,6 +142,8 @@ func initFromConfig() error {
fmt.Println("use config file: ", configPath)
v := viper.New()
v.SetConfigFile(configPath)
// 固定 yaml 格式
v.SetConfigType("yaml")
if err := v.ReadInConfig(); err != nil {
return fmt.Errorf("read config file failed, err: %s", err.Error())
}
Expand Down

0 comments on commit 78d6b08

Please sign in to comment.