kucoin: fix go 1.17 compatibility issue

This commit is contained in:
c9s 2021-12-22 01:45:07 +08:00
parent 3b5015e1ca
commit 388cfe0854
2 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ func (c *RestClient) newAuthenticatedRequest(method, refURL string, params url.V
// set location to UTC so that it outputs "2020-12-08T09:08:57.715Z" // set location to UTC so that it outputs "2020-12-08T09:08:57.715Z"
t := time.Now().In(time.UTC) t := time.Now().In(time.UTC)
// timestamp := t.Format("2006-01-02T15:04:05.999Z07:00") // timestamp := t.Format("2006-01-02T15:04:05.999Z07:00")
timestamp := strconv.FormatInt(t.UnixMilli(), 10) timestamp := strconv.FormatInt(t.UnixNano() / int64(time.Millisecond), 10)
var body []byte var body []byte

View File

@ -96,7 +96,7 @@ func (r *GetFillsRequest) Do(ctx context.Context) (*FillListPage, error) {
return nil, err return nil, err
} }
if !params.Has("tradeType") { if _, ok := params["tradeType"]; !ok {
params.Add("tradeType", "TRADE") params.Add("tradeType", "TRADE")
} }
@ -188,7 +188,7 @@ func (r *ListOrdersRequest) Do(ctx context.Context) (*OrderListPage, error) {
return nil, err return nil, err
} }
if !params.Has("tradeType") { if _, ok := params["tradeType"]; !ok {
params.Add("tradeType", "TRADE") params.Add("tradeType", "TRADE")
} }