1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-08 06:32:27 +08:00

fix golangci-lint failed (#284)

* fix golangci-lint error
This commit is contained in:
silenceper
2020-06-24 14:36:33 +08:00
committed by GitHub
parent b5c70cc206
commit 868b31cb3d
31 changed files with 175 additions and 155 deletions

View File

@@ -22,7 +22,6 @@ func NewEncryptor(context *context.Context) *Encryptor {
return basic
}
var (
// ErrAppIDNotMatch appid不匹配
ErrAppIDNotMatch = errors.New("app id not match")
@@ -36,19 +35,19 @@ var (
// PlainData 用户信息/手机号信息
type PlainData struct {
OpenID string `json:"openId"`
UnionID string `json:"unionId"`
NickName string `json:"nickName"`
Gender int `json:"gender"`
City string `json:"city"`
Province string `json:"province"`
Country string `json:"country"`
AvatarURL string `json:"avatarUrl"`
Language string `json:"language"`
OpenID string `json:"openId"`
UnionID string `json:"unionId"`
NickName string `json:"nickName"`
Gender int `json:"gender"`
City string `json:"city"`
Province string `json:"province"`
Country string `json:"country"`
AvatarURL string `json:"avatarUrl"`
Language string `json:"language"`
PhoneNumber string `json:"phoneNumber"`
PurePhoneNumber string `json:"purePhoneNumber"`
CountryCode string `json:"countryCode"`
Watermark struct {
Watermark struct {
Timestamp int64 `json:"timestamp"`
AppID string `json:"appid"`
} `json:"watermark"`

View File

@@ -74,15 +74,13 @@ func (qrCode *QRCode) fetchCode(urlStr string, body interface{}) (response []byt
err = fmt.Errorf("fetchCode error : errcode=%v , errmsg=%v", result.ErrCode, result.ErrMsg)
return nil, err
}
} else if contentType == "image/jpeg" {
}
if contentType == "image/jpeg" {
// 返回文件
return response, nil
} else {
err = fmt.Errorf("fetchCode error : unknown response content type - %v", contentType)
return nil, err
}
return
err = fmt.Errorf("fetchCode error : unknown response content type - %v", contentType)
return nil, err
}
// CreateWXAQRCode 获取小程序二维码,适用于需要的码数量较少的业务场景

View File

@@ -47,6 +47,8 @@ func (s *Subscribe) Send(msg *Message) (err error) {
}
uri := fmt.Sprintf("%s?access_token=%s", subscribeSendURL, accessToken)
response, err := util.PostJSON(uri, msg)
if err != nil {
return
}
return util.DecodeWithCommonError(response, "Send")
}

View File

@@ -130,5 +130,5 @@ func (tcb *Tcb) BatchDeleteFile(env string, fileIDList []string) (*BatchDeleteFi
}
batchDeleteFileRes := &BatchDeleteFileRes{}
err = util.DecodeWithError(response, batchDeleteFileRes, "BatchDeleteFile")
return batchDeleteFileRes, nil
return batchDeleteFileRes, err
}