Skip to content

Commit 3bb264d

Browse files
committed
fix: configの設定を修正
jsonのkeyとしてアンダースコアを用いていると、うまくデコードできないもよう。
1 parent d6ef59d commit 3bb264d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cmd/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ var (
1515
configKey = [...]string{"api-key", "language", "format", "ai-source"}
1616
configOption = [][]int{
1717
{},
18-
{int(entity.JP), int(entity.EN)},
18+
{int(entity.EN), int(entity.JP)},
1919
{int(entity.NormalFormat), int(entity.EmojiFormat), int(entity.PrefixFormat)},
2020
{int(entity.WrapServer), int(entity.OpenAiAPI)},
2121
}
2222
configOptionLabel = [][]string{
2323
{},
24-
{"Japanese", "English"},
24+
{"English", "Japanese"},
2525
{"Normal Format", "Emoji Format", "PrefixFormat"},
2626
{"Wrap Server", "OpenAI API"},
2727
}

internal/entity/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import (
1111
type Language int
1212

1313
const (
14-
JP Language = iota
15-
EN
14+
EN Language = iota
15+
JP
1616
)
1717

1818
type CodeFormat int
1919

2020
const (
21-
EmojiFormat CodeFormat = iota
21+
NormalFormat CodeFormat = iota
22+
EmojiFormat
2223
PrefixFormat
23-
NormalFormat
2424
)
2525

2626
type AISource int
@@ -31,10 +31,10 @@ const (
3131
)
3232

3333
type Config struct {
34-
ChatGptApiKey string `json:"chatGpt_ApiKey"`
35-
UseLanguage int `json:"Use_Language"`
36-
CommitFormat int `json:"Commit_Format"`
37-
AISource int `json:"AI_Source"`
34+
ChatGptApiKey string `json:"chatGptApiKey"`
35+
UseLanguage int `json:"UseLanguage"`
36+
CommitFormat int `json:"CommitFormat"`
37+
AISource int `json:"AISource"`
3838
}
3939

4040
func (c *Config) Config2PbVars() (pb.CodeFormatType, pb.LanguageType) {

0 commit comments

Comments
 (0)