From 4a13d48870e21f55abe54211d3bf7cf4e4ad2380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 26 Sep 2025 00:00:05 +0800 Subject: [PATCH] chore: make lint happy --- agent.go | 2 +- types.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/agent.go b/agent.go index deab68a..6340287 100644 --- a/agent.go +++ b/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) } diff --git a/types.go b/types.go index ff8dcf8..5130d4b 100644 --- a/types.go +++ b/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)