mirror of
https://github.com/fumiama/go-onebot-agent.git
synced 2026-06-05 02:00:23 +08:00
chore: make lint happy
This commit is contained in:
2
agent.go
2
agent.go
@@ -60,7 +60,7 @@ func (ag *Agent) AddRequest(grp int64, req *zero.APIRequest) {
|
||||
ag.log.Add(grp, req, true)
|
||||
}
|
||||
|
||||
// AddRequest 添加在执行完 zero.APIRequest 之后得到的响应
|
||||
// AddResponse 添加在执行完 zero.APIRequest 之后得到的响应
|
||||
func (ag *Agent) AddResponse(grp int64, resp *APIResponse) {
|
||||
ag.log.Add(grp, resp, false)
|
||||
}
|
||||
|
||||
2
types.go
2
types.go
@@ -39,6 +39,7 @@ func (ev *Event) String() string {
|
||||
return strings.TrimSpace(sb.String())
|
||||
}
|
||||
|
||||
// APIResponse is the simplified OneBot response
|
||||
type APIResponse struct {
|
||||
Status string `json:"status"`
|
||||
Data json.RawMessage `json:"data"`
|
||||
@@ -47,6 +48,7 @@ type APIResponse struct {
|
||||
RetCode int64 `json:"retcode"`
|
||||
}
|
||||
|
||||
// String dumps JSON without tailing \n
|
||||
func (resp *APIResponse) String() string {
|
||||
sb := strings.Builder{}
|
||||
err := json.NewEncoder(&sb).Encode(resp)
|
||||
|
||||
Reference in New Issue
Block a user