From 7c387e43d1a1c04e03bb3532bde65ea1ce478292 Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Thu, 25 May 2023 09:34:35 +0800 Subject: [PATCH] lint fix --- open/open.go | 1 - open/open_test.go | 1 - pkg/bmap/body_map.go | 2 +- pkg/xtime/xtime_test.go | 10 ---------- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/open/open.go b/open/open.go index 59fc62a..302680f 100644 --- a/open/open.go +++ b/open/open.go @@ -22,7 +22,6 @@ type SDK struct { Host string autoManageToken bool // 是否自动维护刷新 AccessToken autoRefreshTokenInternal time.Duration // 自动刷新 token 的间隔时间 - minRefreshTokenDuration time.Duration // 最小刷新 token 的阈值时长 openidAccessTokenMap map[string]*AccessToken // key: openid callback func(at *AT, err error) diff --git a/open/open_test.go b/open/open_test.go index 7d0f52d..fbe5731 100644 --- a/open/open_test.go +++ b/open/open_test.go @@ -12,7 +12,6 @@ import ( var ( ctx = context.Background() openSDK *SDK - err error // 测试时,将自己的Appid和Secret填入,此appid和secret为测试号 Appid = "wxcfad67697020fc14" Secret = "c104683b3067ceac97b680aa5bf62b69" diff --git a/pkg/bmap/body_map.go b/pkg/bmap/body_map.go index 22f34cc..340b5a5 100644 --- a/pkg/bmap/body_map.go +++ b/pkg/bmap/body_map.go @@ -112,7 +112,7 @@ func (bm BodyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error) } for k := range bm { if v := bm.GetString(k); v != "" { - e.Encode(xmlMapMarshal{XMLName: xml.Name{Local: k}, Value: v}) + _ = e.Encode(xmlMapMarshal{XMLName: xml.Name{Local: k}, Value: v}) } } return e.EncodeToken(start.End()) diff --git a/pkg/xtime/xtime_test.go b/pkg/xtime/xtime_test.go index 765b640..fb23cd3 100644 --- a/pkg/xtime/xtime_test.go +++ b/pkg/xtime/xtime_test.go @@ -3,20 +3,10 @@ package xtime import ( "encoding/json" "testing" - "time" "github.com/go-pay/wechat-sdk/pkg/xlog" ) -func TestXtime(t *testing.T) { - minutes := Time(1609066441).Time().Add(time.Minute * 30).Sub(time.Now()).Minutes() - xlog.Debug(minutes) - if minutes < 0 { // 30分钟超时 - //更新订单状态为订单超时 - xlog.Debug("超时") - } -} - type TimeParser struct { T1 Duration `json:"t1"` T2 Duration `json:"t2"`