Preparing report...

Report for github.com/patcharp/golib

(v1.0.0)

A    Great!    Found 43 issues across 44 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!


golint4%

Golint is a linter for Go source code.

    • mq/rabbitmq.go
    • Line 10: warning: exported type Config should have comment or be unexported (golint)
    • Line 19: warning: exported type Client should have comment or be unexported (golint)
    • Line 26: warning: exported function NewMQ should have comment or be unexported (golint)
    • Line 32: warning: exported method Client.Connect should have comment or be unexported (golint)
    • Line 67: warning: exported method Client.Close should have comment or be unexported (golint)
    • Line 74: warning: exported method Client.EnQueue should have comment or be unexported (golint)
    • one/cmp/cmp.go
    • Line 12: warning: exported function New should have comment or be unexported (golint)
    • Line 16: warning: exported method Client.GetConsentStatus should have comment or be unexported (golint)
    • attendant/attendant.go
    • Line 3: warning: comment on exported const DefaultApiEndpoint should be of the form "DefaultApiEndpoint ..." (golint)
    • Line 6: warning: comment on exported type APIResult should be of the form "APIResult ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported function NewClient should be of the form "NewClient ..." (golint)
    • Line 36: warning: exported method Client.SetApiEndpoint should have comment or be unexported (golint)
    • one/chat/chat.go
    • Line 21: warning: exported function NewChatBot should have comment or be unexported (golint)
    • Line 34: warning: exported method Chat.GetProfile should have comment or be unexported (golint)
    • Line 57: warning: exported method Chat.FindFriend should have comment or be unexported (golint)
    • Line 80: warning: exported method Chat.GetOneChatAccessToken should have comment or be unexported (golint)
    • Line 101: warning: exported method Chat.PushBroadcastMessage should have comment or be unexported (golint)
    • Line 118: warning: exported method Chat.PushBroadcastFromByte should have comment or be unexported (golint)
    • Line 132: warning: exported method Chat.PushBroadcastFromFile should have comment or be unexported (golint)
    • Line 167: warning: exported method Chat.PushTextMessage should have comment or be unexported (golint)
    • Line 188: warning: exported method Chat.PushWebView should have comment or be unexported (golint)
    • Line 218: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 223: warning: exported method Chat.PushLinkTemplate should have comment or be unexported (golint)
    • Line 253: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 258: warning: exported method Chat.PushQuickReplyTextType should have comment or be unexported (golint)
    • Line 280: warning: exported method Chat.GetSharedToken should have comment or be unexported (golint)
    • Line 303: warning: exported method Chat.CloseWebView should have comment or be unexported (golint)
    • Line 317: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • server/skipper.go
    • Line 8: warning: exported type SkipperPath should have comment or be unexported (golint)
    • Line 13: warning: exported method SkipperPath.Add should have comment or be unexported (golint)
    • Line 20: warning: exported method SkipperPath.Delete should have comment or be unexported (golint)
    • Line 31: warning: exported method SkipperPath.Test should have comment or be unexported (golint)
    • Line 38: warning: exported function NewSkipperPath should have comment or be unexported (golint)
    • imagik/grabber.go
    • Line 13: warning: exported const MaxTimeout should have comment or be unexported (golint)
    • Line 15: warning: exported function UrlGrabber should have comment or be unexported (golint)
    • cache/redis.go
    • Line 10: warning: exported type Config should have comment or be unexported (golint)
    • Line 17: warning: exported type Redis should have comment or be unexported (golint)
    • Line 21: warning: exported function New should have comment or be unexported (golint)
    • Line 31: warning: exported function NewWithCfg should have comment or be unexported (golint)
    • Line 40: warning: exported method Redis.Ping should have comment or be unexported (golint)
    • Line 47: warning: exported method Redis.Set should have comment or be unexported (golint)
    • Line 58: warning: exported method Redis.Get should have comment or be unexported (golint)
    • Line 71: warning: exported method Redis.FindByPattern should have comment or be unexported (golint)
    • Line 89: warning: exported method Redis.Del should have comment or be unexported (golint)
    • Line 93: warning: exported method Redis.DelByPattern should have comment or be unexported (golint)
    • Line 101: warning: exported method Redis.Flush should have comment or be unexported (golint)
    • Line 105: warning: exported method Redis.FlushByPattern should have comment or be unexported (golint)
    • Line 109: warning: exported method Redis.IsKeyNotFound should have comment or be unexported (golint)
    • Line 116: warning: exported method Redis.SetExpire should have comment or be unexported (golint)
    • Line 120: warning: exported method Redis.SetExpireAt should have comment or be unexported (golint)
    • util/httputil/token.go
    • Line 9: warning: comment on exported function GetTokenFromHeader should be of the form "GetTokenFromHeader ..." (golint)
    • Line 21: warning: exported function GetQueryId should have comment or be unexported (golint)
    • crypto/cryptojs.go
    • Line 7: warning: exported function CryptoJSEncrypt should have comment or be unexported (golint)
    • Line 12: warning: exported function CryptoJSDecrypt should have comment or be unexported (golint)
    • crypto/secret.go
    • Line 14: warning: exported function GenSecretString should have comment or be unexported (golint)
    • Line 23: warning: exported function HashPassword should have comment or be unexported (golint)
    • Line 28: warning: exported function ComparePasswordHash should have comment or be unexported (golint)
    • Line 33: warning: comment on exported function ValidateString should be of the form "ValidateString ..." (golint)
    • one/identity/model.go
    • Line 8: warning: exported const ProductionEndpoint should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type IdCredential should have comment or be unexported (golint)
    • Line 23: warning: exported type Client should have comment or be unexported (golint)
    • Line 30: warning: comment on exported type AuthenticationResult should be of the form "AuthenticationResult ..." (with optional leading article) (golint)
    • Line 42: warning: comment on exported type AccountProfile should be of the form "AccountProfile ..." (with optional leading article) (golint)
    • Line 80: warning: exported type AccountMobile should have comment or be unexported (golint)
    • Line 91: warning: exported type AccountMobilePivot should have comment or be unexported (golint)
    • Line 102: warning: exported type AccountEmail should have comment or be unexported (golint)
    • Line 113: warning: exported type AccountEmailPivot should have comment or be unexported (golint)
    • Line 128: warning: exported type OrgClient should have comment or be unexported (golint)
    • Line 135: warning: exported type OrgApiResult should have comment or be unexported (golint)
    • Line 142: warning: exported type Department should have comment or be unexported (golint)
    • Line 149: warning: exported type TeamMember should have comment or be unexported (golint)
    • Line 156: warning: exported type HeadDepartment should have comment or be unexported (golint)
    • Line 163: warning: exported type Employee should have comment or be unexported (golint)
    • helper/date.go
    • Line 11: warning: exported type Date should have comment or be unexported (golint)
    • Line 15: warning: exported method Date.ToDateTime should have comment or be unexported (golint)
    • Line 19: warning: exported method Date.Set should have comment or be unexported (golint)
    • Line 23: warning: exported method Date.Convert should have comment or be unexported (golint)
    • Line 38: warning: exported method Date.NextDay should have comment or be unexported (golint)
    • Line 42: warning: exported method Date.PreviousDay should have comment or be unexported (golint)
    • geomap/model.go
    • Line 7: warning: exported type Map should have comment or be unexported (golint)
    • Line 11: warning: exported type Property should have comment or be unexported (golint)
    • database/gorm.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: exported type Config should have comment or be unexported (golint)
    • Line 26: warning: exported type Database should have comment or be unexported (golint)
    • Line 35: warning: exported const DriverMSSQL should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported function GetConnectionContext should have comment or be unexported (golint)
    • Line 49: warning: exported function NewWithConfig should have comment or be unexported (golint)
    • Line 56: warning: exported method Database.Connect should have comment or be unexported (golint)
    • Line 110: warning: exported method Database.Reconnect should have comment or be unexported (golint)
    • Line 119: warning: exported method Database.Ctx should have comment or be unexported (golint)
    • Line 123: warning: exported method Database.MigrateDatabase should have comment or be unexported (golint)
    • Line 134: warning: exported method Database.SetDebugMode should have comment or be unexported (golint)
    • Line 160: warning: exported method Database.Close should have comment or be unexported (golint)
    • crypto/token.go
    • Line 12: warning: exported function EncodeJWTAccessToken should have comment or be unexported (golint)
    • Line 18: warning: exported function DecodeJWTAccessToken should have comment or be unexported (golint)
    • Line 31: warning: exported function EncodeRefreshToken should have comment or be unexported (golint)
    • Line 45: warning: exported function DecodeRefreshToken should have comment or be unexported (golint)
    • requests/http.go
    • Line 8: warning: exported const Timeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type Response should have comment or be unexported (golint)
    • one/chat/model.go
    • Line 4: warning: exported const ProductionEndpoint should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: exported type Chat should have comment or be unexported (golint)
    • Line 17: warning: exported type Friend should have comment or be unexported (golint)
    • Line 25: warning: exported type Profile should have comment or be unexported (golint)
    • Line 33: warning: exported type LoginOneChatAccount should have comment or be unexported (golint)
    • Line 59: warning: exported type LoginOneChatResult should have comment or be unexported (golint)
    • Line 67: warning: exported type Choice should have comment or be unexported (golint)
    • Line 75: warning: exported type Elements should have comment or be unexported (golint)
    • Line 82: warning: exported type QuickReplyTextType should have comment or be unexported (golint)
    • server/echo.go
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 25: warning: exported type Server should have comment or be unexported (golint)
    • Line 30: warning: exported function New should have comment or be unexported (golint)
    • Line 61: warning: exported method Server.Run should have comment or be unexported (golint)
    • Line 68: warning: exported method Server.Ctx should have comment or be unexported (golint)
    • Line 72: warning: exported method Server.EnableMetrics should have comment or be unexported (golint)
    • Line 93: warning: exported method Server.EnableCORS should have comment or be unexported (golint)
    • crontab/crontab.go
    • Line 7: warning: exported type Service should have comment or be unexported (golint)
    • Line 11: warning: exported function NewService should have comment or be unexported (golint)
    • Line 15: warning: exported method Service.Start should have comment or be unexported (golint)
    • Line 19: warning: exported method Service.Stop should have comment or be unexported (golint)
    • Line 25: warning: exported method Service.AddFunc should have comment or be unexported (golint)
    • Line 29: warning: exported method Service.AddJob should have comment or be unexported (golint)
    • Line 33: warning: exported method Service.RemoveJob should have comment or be unexported (golint)
    • Line 37: warning: exported method Service.GetEntryJob should have comment or be unexported (golint)
    • Line 41: warning: exported method Service.GetEntryJobs should have comment or be unexported (golint)
    • crontab/spec.go
    • Line 4: warning: comment on exported const SpecEveryMinute should be of the form "SpecEveryMinute ..." (golint)
    • Line 6: warning: exported const SpecEvery5Min should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: comment on exported const SpecEveryHour should be of the form "SpecEveryHour ..." (golint)
    • Line 18: warning: comment on exported const SpecEveryDay should be of the form "SpecEveryDay ..." (golint)
    • Line 30: warning: comment on exported const SpecEveryMidnight should be of the form "SpecEveryMidnight ..." (golint)
    • database/model.go
    • Line 30: warning: comment on exported type Preload should be of the form "Preload ..." (with optional leading article) (golint)
    • Line 36: warning: comment on exported type Where should be of the form "Where ..." (with optional leading article) (golint)
    • crypto/aes.go
    • Line 12: warning: exported function AESEncrypt should have comment or be unexported (golint)
    • Line 24: warning: exported function AESDecrypt should have comment or be unexported (golint)
    • one/identity/identity.go
    • Line 13: warning: exported function NewIdentity should have comment or be unexported (golint)
    • Line 26: warning: exported method Client.Login should have comment or be unexported (golint)
    • Line 49: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 63: warning: exported method Client.RefreshNewToken should have comment or be unexported (golint)
    • Line 87: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 95: warning: exported method Client.VerifyAuthorizedCode should have comment or be unexported (golint)
    • Line 126: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 140: warning: exported method Client.LoginWithScope should have comment or be unexported (golint)
    • Line 165: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 179: warning: exported method Client.GetProfile should have comment or be unexported (golint)
    • Line 198: warning: exported method Client.GetLoginUrl should have comment or be unexported (golint)
    • Line 206: warning: exported method Client.RedirectToLoginUrl should have comment or be unexported (golint)
    • server/api.go
    • Line 3: warning: exported type Result should have comment or be unexported (golint)
    • geomap/polygon.go
    • Line 12: warning: exported function NewMap should have comment or be unexported (golint)
    • Line 25: warning: exported function Point should have comment or be unexported (golint)
    • Line 29: warning: comment on exported method Map.IsInside should be of the form "IsInside ..." (golint)
    • util/httputil/http.go
    • Line 85: warning: comment on exported type Json should be of the form "Json ..." (with optional leading article) (golint)
    • Line 89: warning: comment on exported type Headers should be of the form "Headers ..." (with optional leading article) (golint)
    • server/cors.go
    • Line 10: warning: exported function EnableCORS should have comment or be unexported (golint)
    • server/pagination.go
    • Line 9: warning: exported const DefaultQueryPage should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported type Pagination should have comment or be unexported (golint)
    • Line 19: warning: exported function GetPagination should have comment or be unexported (golint)
    • Line 29: warning: exported method Pagination.Offset should have comment or be unexported (golint)
    • cache/cluster.go
    • Line 10: warning: exported type ClusterConfig should have comment or be unexported (golint)
    • Line 15: warning: exported type Cluster should have comment or be unexported (golint)
    • Line 19: warning: exported function NewClusterClient should have comment or be unexported (golint)
    • Line 28: warning: exported function NewClusterWithCfg should have comment or be unexported (golint)
    • Line 35: warning: exported method Cluster.Ping should have comment or be unexported (golint)
    • Line 42: warning: exported method Cluster.Set should have comment or be unexported (golint)
    • Line 53: warning: exported method Cluster.Get should have comment or be unexported (golint)
    • Line 66: warning: exported method Cluster.FindByPattern should have comment or be unexported (golint)
    • Line 84: warning: exported method Cluster.Del should have comment or be unexported (golint)
    • Line 88: warning: exported method Cluster.DelByPattern should have comment or be unexported (golint)
    • Line 96: warning: exported method Cluster.Flush should have comment or be unexported (golint)
    • Line 100: warning: exported method Cluster.FlushByPattern should have comment or be unexported (golint)
    • Line 104: warning: exported method Cluster.IsKeyNotFound should have comment or be unexported (golint)
    • Line 111: warning: exported method Cluster.SetExpire should have comment or be unexported (golint)
    • Line 115: warning: exported method Cluster.SetExpireAt should have comment or be unexported (golint)
    • one/cmp/model.go
    • Line 4: warning: exported const ProductionEndpoint should have comment (or a comment on this block) or be unexported (golint)
    • Line 7: warning: exported type Client should have comment or be unexported (golint)
    • Line 11: warning: exported type ConsentRequestForm should have comment or be unexported (golint)
    • Line 18: warning: exported type StatusResult should have comment or be unexported (golint)
    • Line 25: warning: exported type StatusInfo should have comment or be unexported (golint)
    • Line 30: warning: exported type ChatResponse should have comment or be unexported (golint)
    • Line 36: warning: exported type Elements should have comment or be unexported (golint)
    • Line 43: warning: exported type Choice should have comment or be unexported (golint)
    • attendant/account.go
    • Line 28: warning: exported method Client.GetAvatarByID should have comment or be unexported (golint)
    • Line 40: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 90: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • attendant/companie.go
    • Line 22: warning: comment on exported method Client.GetCompanyEmployee should be of the form "GetCompanyEmployee ..." (golint)
    • helper/http.go
    • Line 15: warning: comment on exported function HttpResponse should be of the form "HttpResponse ..." (golint)
    • Line 22: warning: comment on exported function HttpOk should be of the form "HttpOk ..." (golint)
    • Line 37: warning: comment on exported function HttpOkWithTotal should be of the form "HttpOkWithTotal ..." (golint)
    • Line 53: warning: comment on exported function HttpCreated should be of the form "HttpCreated ..." (golint)
    • Line 61: warning: comment on exported function HttpNoContent should be of the form "HttpNoContent ..." (golint)
    • Line 68: warning: comment on exported function HttpBlob should be of the form "HttpBlob ..." (golint)
    • Line 75: warning: exported function HttpBlobWithCode should have comment or be unexported (golint)
    • Line 79: warning: comment on exported function HttpRedirect should be of the form "HttpRedirect ..." (golint)
    • Line 86: warning: exported function HttpRedirectWithCode should have comment or be unexported (golint)
    • Line 90: warning: comment on exported function HttpInvalidRequest should be of the form "HttpInvalidRequest ..." (golint)
    • Line 115: warning: comment on exported function HttpErrBadRequest should be of the form "HttpErrBadRequest ..." (golint)
    • Line 120: warning: comment on exported function HttpErrUnAuthorize should be of the form "HttpErrUnAuthorize ..." (golint)
    • Line 125: warning: comment on exported function HttpErrForbidden should be of the form "HttpErrForbidden ..." (golint)
    • Line 130: warning: comment on exported function HttpErrNotFound should be of the form "HttpErrNotFound ..." (golint)
    • Line 135: warning: comment on exported function HttpErrConflict should be of the form "HttpErrConflict ..." (golint)
    • Line 140: warning: comment on exported function HttpServerError should be of the form "HttpServerError ..." (golint)
    • Line 163: warning: comment on exported function HttpErrServerError should be of the form "HttpErrServerError ..." (golint)
    • Line 168: warning: comment on exported function HttpServiceUnavailableError should be of the form "HttpServiceUnavailableError ..." (golint)
    • util/common.go
    • Line 10: warning: exported function GetEnv should have comment or be unexported (golint)
    • Line 17: warning: exported function AtoI should have comment or be unexported (golint)
    • Line 25: warning: exported function AtoF should have comment or be unexported (golint)
    • Line 33: warning: exported function Contains should have comment or be unexported (golint)
    • Line 42: warning: comment on exported function StringDisplayWidth should be of the form "StringDisplayWidth ..." (golint)
    • util/time.go
    • Line 7: warning: exported function GetStartTimeOfDay should have comment or be unexported (golint)
    • crypto/rsa.go
    • Line 13: warning: exported function InitRSAKey should have comment or be unexported (golint)
    • Line 20: warning: exported function ReadRSAPrivateKeyFromPEM should have comment or be unexported (golint)
    • Line 33: warning: exported function ReadRSAPublicKeyFromPEM should have comment or be unexported (golint)
    • Line 46: warning: exported function RSAPrivateKeyToPEM should have comment or be unexported (golint)
    • Line 57: warning: exported function RSAPublicKeyToPEM should have comment or be unexported (golint)
    • Line 68: warning: exported function RSAEncrypt should have comment or be unexported (golint)
    • Line 72: warning: exported function RSADecrypt should have comment or be unexported (golint)
    • Line 76: warning: exported function SignByRSAKey should have comment or be unexported (golint)
    • Line 91: warning: exported function VerifySignedByRSAKey should have comment or be unexported (golint)
    • requests/requests.go
    • Line 12: warning: exported function Request should have comment or be unexported (golint)
    • Line 47: warning: exported function Get should have comment or be unexported (golint)
    • Line 51: warning: exported function Post should have comment or be unexported (golint)
    • Line 55: warning: exported function Put should have comment or be unexported (golint)
    • Line 59: warning: exported function Delete should have comment or be unexported (golint)
    • imagik/imagik.go
    • Line 16: warning: exported const RotateSquare should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported type Imagik should have comment or be unexported (golint)
    • Line 27: warning: exported method Imagik.LoadFromFile should have comment or be unexported (golint)
    • Line 36: warning: exported method Imagik.LoadFromByte should have comment or be unexported (golint)
    • Line 45: warning: exported method Imagik.LoadFromUrl should have comment or be unexported (golint)
    • Line 56: warning: exported method Imagik.Bounds should have comment or be unexported (golint)
    • Line 60: warning: exported method Imagik.IsSquare should have comment or be unexported (golint)
    • Line 67: warning: exported method Imagik.Rotation should have comment or be unexported (golint)
    • Line 76: warning: exported method Imagik.Resize should have comment or be unexported (golint)
    • Line 80: warning: exported method Imagik.CropCenter should have comment or be unexported (golint)
    • Line 84: warning: exported method Imagik.Crop should have comment or be unexported (golint)
    • Line 88: warning: exported method Imagik.SquareThumbnailAsPNGByte should have comment or be unexported (golint)
    • Line 106: warning: exported method Imagik.ThumbnailAsByte should have comment or be unexported (golint)
    • Line 115: warning: exported method Imagik.ThumbnailAsFile should have comment or be unexported (golint)
    • Line 123: warning: exported method Imagik.ExportAsDataUrl should have comment or be unexported (golint)
    • Line 131: warning: exported method Imagik.ExportAsPNGDataUrl should have comment or be unexported (golint)
    • Line 139: warning: exported method Imagik.ExportAsByte should have comment or be unexported (golint)
    • Line 147: warning: exported method Imagik.ExportAsPNGByte should have comment or be unexported (golint)
    • Line 155: warning: exported method Imagik.ExportAsPNGByteWithCompLevel should have comment or be unexported (golint)
    • Line 163: warning: exported method Imagik.ExportAsFile should have comment or be unexported (golint)
    • Line 170: warning: exported method Imagik.ExportAsPNGFile should have comment or be unexported (golint)
    • helper/thai.go
    • Line 9: warning: exported var ThaiWeekDay should have comment or be unexported (golint)
    • Line 59: warning: exported function ConvertTimeToThaiFullDateTimeFormat should have comment or be unexported (golint)
    • Line 66: warning: exported function ConvertTimeToThaiFullDateFormat should have comment or be unexported (golint)
    • Line 75: warning: exported function ConvertTimeToThaiShortDateFormat should have comment or be unexported (golint)
    • Line 84: warning: exported function ConvertTimeToThaiFullTimeFormat should have comment or be unexported (golint)
    • Line 91: warning: exported function ConvertTimeToThaiShortTimeFormat should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign88%

IneffAssign detects ineffectual assignments in Go code.

    • attendant/account.go
    • Line 21: warning: ineffectual assignment to err (ineffassign)
    • Line 52: warning: ineffectual assignment to err (ineffassign)
    • Line 66: warning: ineffectual assignment to err (ineffassign)

misspell97%

Misspell Finds commonly misspelled English words