Preparing report...

Report for github.com/golib2020/wechat

A+    Excellent!    Found 63 issues across 82 files

Tweet

gofmt97%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo100%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

No problems detected. Good job!


golint24%

Golint is a linter for Go source code.

    • wechat/mini/option.go
    • Line 9: warning: exported type Option should have comment or be unexported (golint)
    • Line 11: warning: exported function WithCache should have comment or be unexported (golint)
    • wechat/pay/notify/refund.go
    • Line 12: warning: exported type RefundResponse should have comment or be unexported (golint)
    • Line 20: warning: exported type RefundReqInfo should have comment or be unexported (golint)
    • wechat/pay/ctx.go
    • Line 11: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 24: warning: exported function New should have comment or be unexported (golint)
    • wechat/mp/material/ctx.go
    • Line 3: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 11: warning: exported function New should have comment or be unexported (golint)
    • wechat/work/user/ctx.go
    • Line 3: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 15: warning: exported function New should have comment or be unexported (golint)
    • wechat/open/option.go
    • Line 9: warning: exported type Option should have comment or be unexported (golint)
    • Line 11: warning: exported function WithCache should have comment or be unexported (golint)
    • wechat/pay/internal/error.go
    • Line 7: warning: exported type ReturnError should have comment or be unexported (golint)
    • Line 12: warning: exported method ReturnError.Check should have comment or be unexported (golint)
    • Line 19: warning: exported type ResultError should have comment or be unexported (golint)
    • Line 25: warning: exported method ResultError.Check should have comment or be unexported (golint)
    • Line 32: warning: exported type ResponseError should have comment or be unexported (golint)
    • Line 37: warning: exported method ResponseError.Check should have comment or be unexported (golint)
    • wechat/work/ctx.go
    • Line 11: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 25: warning: exported function New should have comment or be unexported (golint)
    • wechat/mp/qrcode/ctx.go
    • Line 5: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 14: warning: exported function New should have comment or be unexported (golint)
    • wechat/mini/ctx.go
    • Line 10: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 22: warning: exported function New should have comment or be unexported (golint)
    • wechat/mp/message/serve.go
    • Line 13: warning: exported type Replyer should have comment or be unexported (golint)
    • Line 17: warning: exported type RequestBody should have comment or be unexported (golint)
    • Line 49: warning: exported type Server should have comment or be unexported (golint)
    • Line 55: warning: comment on exported function NewServe should be of the form "NewServe ..." (golint)
    • Line 62: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 72: warning: comment on exported method Server.Push should be of the form "Push ..." (golint)
    • wechat/internal/crypto.go
    • Line 18: warning: exported function PKCS7Padding should have comment or be unexported (golint)
    • Line 24: warning: exported function PKCS7UnPadding should have comment or be unexported (golint)
    • Line 30: warning: exported function AesECBDecrypt should have comment or be unexported (golint)
    • Line 51: warning: exported function AesECBEncrypt should have comment or be unexported (golint)
    • Line 71: warning: exported function AesCBCEncrypt should have comment or be unexported (golint)
    • Line 88: warning: exported function AesCBCDecrypt should have comment or be unexported (golint)
    • Line 108: warning: exported function HmacSha256 should have comment or be unexported (golint)
    • Line 114: warning: exported function Sha256 should have comment or be unexported (golint)
    • Line 120: warning: exported function Md5 should have comment or be unexported (golint)
    • Line 126: warning: exported function Sha1 should have comment or be unexported (golint)
    • wechat/pay/order/ctx.go
    • Line 15: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 27: warning: exported function New should have comment or be unexported (golint)
    • wechat/mp/auth/user.go
    • Line 11: warning: exported type BaseResponse should have comment or be unexported (golint)
    • Line 21: warning: exported type UserinfoResponse should have comment or be unexported (golint)
    • wechat/mp/message/msg/message.go
    • Line 3: warning: comment on exported type Base should be of the form "Base ..." (with optional leading article) (golint)
    • Line 10: warning: exported type Custom should have comment or be unexported (golint)
    • wechat/mp/media/ctx.go
    • Line 7: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 20: warning: exported function New should have comment or be unexported (golint)
    • wechat/work/option.go
    • Line 12: warning: exported type Option should have comment or be unexported (golint)
    • Line 14: warning: exported function WithAgentId should have comment or be unexported (golint)
    • Line 20: warning: exported function WithCache should have comment or be unexported (golint)
    • wechat/mp/auth/ctx.go
    • Line 3: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 17: warning: exported function New should have comment or be unexported (golint)
    • wechat/work/checkin/ctx.go
    • Line 8: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 17: warning: exported function New should have comment or be unexported (golint)
    • wechat/internal/response/error.go
    • Line 8: warning: exported type Checker should have comment or be unexported (golint)
    • Line 12: warning: exported type Error should have comment or be unexported (golint)
    • Line 17: warning: exported method Error.Check should have comment or be unexported (golint)
    • wechat/pay/internal/sign.go
    • Line 14: warning: exported type CDATA should have comment or be unexported (golint)
    • Line 16: warning: exported method CDATA.MarshalXML should have comment or be unexported (golint)
    • wechat/work/appchat/get.go
    • Line 10: warning: exported type GetResponse should have comment or be unexported (golint)
    • Line 13: warning: exported type ChatInfo should have comment or be unexported (golint)
    • wechat/pay/order/unify.go
    • Line 7: warning: exported type UnifyResponse should have comment or be unexported (golint)
    • Line 20: warning: exported type UnifyParam should have comment or be unexported (golint)
    • Line 45: warning: exported method UnifyParam.SetDetail should have comment or be unexported (golint)
    • Line 50: warning: exported method UnifyParam.SetSceneInfo should have comment or be unexported (golint)
    • wechat/mp/qrcode/response.go
    • Line 25: warning: comment on exported method Response.Save should be of the form "Save ..." (golint)
    • Line 35: warning: comment on exported method Response.Writer should be of the form "Writer ..." (golint)
    • wechat/mp/message/ctx.go
    • Line 9: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 21: warning: exported function New should have comment or be unexported (golint)
    • wechat/mini/wxacode/ctx.go
    • Line 14: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 21: warning: exported const GetApi should have comment (or a comment on this block) or be unexported (golint)
    • wechat/work/wxbizmsgcrypt/wxbizmsgcrypt.go
    • Line 20: warning: exported const ValidateSignatureError should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported type ProtocolType should have comment or be unexported (golint)
    • Line 39: warning: exported const XmlType should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type CryptError should have comment or be unexported (golint)
    • Line 47: warning: exported function NewCryptError should have comment or be unexported (golint)
    • Line 47: warning: don't use underscores in Go names; func parameter err_code should be errCode (golint)
    • Line 47: warning: don't use underscores in Go names; func parameter err_msg should be errMsg (golint)
    • Line 51: warning: exported type WXBizMsg4Recv should have comment or be unexported (golint)
    • Line 57: warning: exported type CDATA should have comment or be unexported (golint)
    • Line 61: warning: exported type WXBizMsg4Send should have comment or be unexported (golint)
    • Line 69: warning: exported function NewWXBizMsg4Send should have comment or be unexported (golint)
    • Line 73: warning: exported type ProtocolProcessor should have comment or be unexported (golint)
    • Line 74: warning: don't use underscores in Go names; interface method parameter src_data should be srcData (golint)
    • Line 75: warning: don't use underscores in Go names; interface method parameter msg_send should be msgSend (golint)
    • Line 78: warning: exported type WXBizMsgCrypt should have comment or be unexported (golint)
    • Line 80: warning: don't use underscores in Go names; struct field encoding_aeskey should be encodingAeskey (golint)
    • Line 81: warning: don't use underscores in Go names; struct field receiver_id should be receiverID (golint)
    • Line 82: warning: don't use underscores in Go names; struct field protocol_processor should be protocolProcessor (golint)
    • Line 85: warning: exported type XmlProcessor should have comment or be unexported (golint)
    • Line 88: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 88: warning: don't use underscores in Go names; method parameter src_data should be srcData (golint)
    • Line 89: warning: don't use underscores in Go names; var msg4_recv should be msg4Recv (golint)
    • Line 97: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 97: warning: don't use underscores in Go names; method parameter msg4_send should be msg4Send (golint)
    • Line 98: warning: don't use underscores in Go names; var xml_msg should be xmlMsg (golint)
    • Line 105: warning: exported function NewWXBizMsgCrypt should have comment or be unexported (golint)
    • Line 105: warning: don't use underscores in Go names; func parameter encoding_aeskey should be encodingAeskey (golint)
    • Line 105: warning: don't use underscores in Go names; func parameter receiver_id should be receiverID (golint)
    • Line 105: warning: don't use underscores in Go names; func parameter protocol_type should be protocolType (golint)
    • Line 106: warning: don't use underscores in Go names; var protocol_processor should be protocolProcessor (golint)
    • Line 116: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 124: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 124: warning: don't use underscores in Go names; method parameter block_size should be blockSize (golint)
    • Line 133: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 133: warning: don't use underscores in Go names; method parameter block_size should be blockSize (golint)
    • Line 134: warning: don't use underscores in Go names; var plaintext_len should be plaintextLen (golint)
    • Line 141: warning: don't use underscores in Go names; var padding_len should be paddingLen (golint)
    • Line 145: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 150: warning: don't use underscores in Go names; const block_size should be blockSize (golint)
    • Line 151: warning: don't use underscores in Go names; var pad_msg should be padMsg (golint)
    • Line 164: warning: don't use underscores in Go names; var base64_msg should be base64Msg (golint)
    • Line 170: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 170: warning: don't use underscores in Go names; method parameter base64_encrypt_msg should be base64EncryptMsg (golint)
    • Line 176: warning: don't use underscores in Go names; var encrypt_msg should be encryptMsg (golint)
    • Line 203: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 204: warning: don't use underscores in Go names; var sort_arr should be sortArr (golint)
    • Line 217: warning: exported method WXBizMsgCrypt.ParsePlainText should have comment or be unexported (golint)
    • Line 217: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 218: warning: don't use underscores in Go names; const block_size should be blockSize (golint)
    • Line 224: warning: don't use underscores in Go names; var text_len should be textLen (golint)
    • Line 229: warning: don't use underscores in Go names; var msg_len should be msgLen (golint)
    • Line 235: warning: don't use underscores in Go names; var receiver_id should be receiverID (golint)
    • Line 240: warning: exported method WXBizMsgCrypt.VerifyURL should have comment or be unexported (golint)
    • Line 240: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 240: warning: don't use underscores in Go names; method parameter msg_signature should be msgSignature (golint)
    • Line 252: warning: don't use underscores in Go names; var receiver_id should be receiverID (golint)
    • Line 265: warning: exported method WXBizMsgCrypt.EncryptMsg should have comment or be unexported (golint)
    • Line 265: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 265: warning: don't use underscores in Go names; method parameter reply_msg should be replyMsg (golint)
    • Line 266: warning: don't use underscores in Go names; var rand_str should be randStr (golint)
    • Line 270: warning: don't use underscores in Go names; var msg_len_buf should be msgLenBuf (golint)
    • Line 275: warning: don't use underscores in Go names; var tmp_ciphertext should be tmpCiphertext (golint)
    • Line 283: warning: don't use underscores in Go names; var msg4_send should be msg4Send (golint)
    • Line 287: warning: exported method WXBizMsgCrypt.DecryptMsg should have comment or be unexported (golint)
    • Line 287: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 287: warning: don't use underscores in Go names; method parameter msg_signature should be msgSignature (golint)
    • Line 287: warning: don't use underscores in Go names; method parameter post_data should be postData (golint)
    • Line 288: warning: don't use underscores in Go names; var msg4_recv should be msg4Recv (golint)
    • Line 288: warning: don't use underscores in Go names; var crypt_err should be cryptErr (golint)
    • Line 299: warning: don't use underscores in Go names; var crypt_err should be cryptErr (golint)
    • Line 304: warning: don't use underscores in Go names; var receiver_id should be receiverID (golint)
    • Line 304: warning: don't use underscores in Go names; var crypt_err should be cryptErr (golint)
    • wechat/work/appchat/ctx.go
    • Line 7: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 18: warning: exported function New should have comment or be unexported (golint)
    • wechat/work/message/send.go
    • Line 11: warning: exported type SendParam should have comment or be unexported (golint)
    • Line 20: warning: exported type Sender should have comment or be unexported (golint)
    • Line 24: warning: exported type SendResponse should have comment or be unexported (golint)
    • wechat/mp/ctx.go
    • Line 12: warning: exported type Ctx should have comment or be unexported (golint)
    • Line 29: warning: exported function New should have comment or be unexported (golint)
    • wechat/work/user/get.go
    • Line 10: warning: exported type User should have comment or be unexported (golint)
    • Line 31: warning: exported type Text should have comment or be unexported (golint)
    • Line 34: warning: exported type Web should have comment or be unexported (golint)
    • Line 38: warning: exported type Attrs should have comment or be unexported (golint)
    • Line 44: warning: exported type Extattr should have comment or be unexported (golint)
    • Line 47: warning: exported type Miniprogram should have comment or be unexported (golint)
    • Line 52: warning: exported type ExternalAttr should have comment or be unexported (golint)
    • Line 59: warning: exported type ExternalProfile should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words