Skip to content

Commit e349ba4

Browse files
committed
fix: fix viper josn Unmarshal error
1 parent e7e887d commit e349ba4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/config/config.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import (
66
)
77

88
type Gpt struct {
9-
ApiKey string `json:"api_key"` // eg. sk-xxxxxxxxxx
10-
Model string `json:"model"` // eg. gpt-3.5-turbo
9+
ApiKey string `json:"api_key" mapstructure:"api_key"` // eg. sk-xxxxxxxxxx
10+
Model string `json:"model" mapstructure:"model"` // eg. gpt-3.5-turbo
1111
}
1212

1313
type Config struct {
14-
Lang string `json:"lang"`
15-
Env string `json:"env"` // eg. en, cn
16-
Gpt *Gpt `json:"gpt"`
14+
Lang string `json:"lang" mapstructure:"lang"`
15+
Env string `json:"env" mapstructure:"env"` // eg. en, cn
16+
Gpt *Gpt `json:"gpt" mapstructure:"gpt"`
1717
}
1818

1919
const configPath = ".leetcode.json"

0 commit comments

Comments
 (0)