Skip to content

Commit

Permalink
chore: make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 22, 2024
1 parent 632cea9 commit b859c50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ linters:
#- depguard
- dogsled
- errcheck
- exportloopref
- copyloopvar
- exhaustive
#- funlen
#- goconst
Expand Down
11 changes: 5 additions & 6 deletions aireply/lolimi.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ func (l *LolimiAi) TalkPlain(_ int64, msg, nickname string) string {
),
)
if err != nil {
//panic(err)
return "ERROR: " + err.Error()
}
// TODO: 可能会返回
// "请使用psot格式请求如有疑问进官方群"
data, err = web.PostData(u, "application/json", bytes.NewReader(json))
if err != nil {
return "ERROR: " + err.Error()
}
} else {
u := fmt.Sprintf(l.u, url.QueryEscape(l.k), url.QueryEscape(msg))
data, err = web.GetData(u)
Expand Down Expand Up @@ -114,13 +116,10 @@ func (l *LolimiAi) TalkPlain(_ int64, msg, nickname string) string {
}
if l.l > 0 {
// 添加记忆
var m []lolimiMessage
if len(l.m) >= l.l-1 && len(l.m) >= 2 {
m = l.m[2:]
} else {
m = l.m
l.m = l.m[2:]
}
l.m = append(m,
l.m = append(l.m,
lolimiMessage{
Role: "user", Content: msg,
},
Expand Down

2 comments on commit b859c50

@EatHatsuneShallots
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fumiama
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/FloatTech/AnimeAPI/blob/main/aireply%2Flolimi.go#L88-L90 不要移除从错误信息移除密钥的代码

原始写法下下面的密钥删除永远不会触及此err,作用域没写对。我改改吧。

Please sign in to comment.