Preparing report...

Report for github.com/silentred/toolkit

A+    Excellent!    Found 29 issues across 55 files

Tweet

gofmt94%

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!


golint58%

Golint is a linter for Go source code.

    • toolkit/util/error.go
    • Line 6: warning: exported var NoError should have comment or be unexported (golint)
    • Line 9: warning: exported type Error should have comment or be unexported (golint)
    • Line 14: warning: exported type Reply should have comment or be unexported (golint)
    • Line 31: warning: exported function NewError should have comment or be unexported (golint)
    • Line 35: warning: exported function NewReply should have comment or be unexported (golint)
    • toolkit/util/grpool/grpool.go
    • Line 1: warning: package comment should be of the form "Package grpool ..." (golint)
    • Line 14: warning: don't use underscores in Go names; const gDEFAULT_EXPIRE_TIME should be gDEFAULTEXPIRETIME (golint)
    • Line 15: warning: don't use underscores in Go names; const gDEFAULT_CLEAR_INTERVAL should be gDEFAULTCLEARINTERVAL (golint)
    • Line 18: warning: comment on exported type Pool should be of the form "Pool ..." (with optional leading article) (golint)
    • Line 30: warning: comment on exported type PoolJob should be of the form "PoolJob ..." (with optional leading article) (golint)
    • Line 41: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 62: warning: comment on exported function Add should be of the form "Add ..." (golint)
    • Line 67: warning: comment on exported function Size should be of the form "Size ..." (golint)
    • Line 72: warning: comment on exported function Jobs should be of the form "Jobs ..." (golint)
    • Line 77: warning: comment on exported function SetSize should be of the form "SetSize ..." (golint)
    • Line 82: warning: comment on exported function SetExpire should be of the form "SetExpire ..." (golint)
    • Line 87: warning: comment on exported method Pool.Add should be of the form "Add ..." (golint)
    • Line 93: warning: comment on exported method Pool.Size should be of the form "Size ..." (golint)
    • Line 98: warning: comment on exported method Pool.Jobs should be of the form "Jobs ..." (golint)
    • Line 103: warning: comment on exported method Pool.SetSize should be of the form "SetSize ..." (golint)
    • Line 108: warning: comment on exported method Pool.SetExpire should be of the form "SetExpire ..." (golint)
    • Line 113: warning: comment on exported method Pool.Close should be of the form "Close ..." (golint)
    • toolkit/service/mysql.go
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 85: warning: exported function NewXormEngine should have comment or be unexported (golint)
    • toolkit/util/http.go
    • Line 16: warning: exported type HTTPClientIface should have comment or be unexported (golint)
    • Line 21: warning: exported type Response should have comment or be unexported (golint)
    • Line 26: warning: exported type HTTPClient should have comment or be unexported (golint)
    • Line 31: warning: exported function NewHTTPClient should have comment or be unexported (golint)
    • Line 73: warning: exported method HTTPClient.Do should have comment or be unexported (golint)
    • Line 150: warning: exported function MustLoadCertificates should have comment or be unexported (golint)
    • Line 168: warning: exported function MustGetTlsConfiguration should have comment or be unexported (golint)
    • toolkit/util/cryptomode/ecb.go
    • Line 19: warning: exported function NewECBEncrypter should have comment or be unexported (golint)
    • Line 41: warning: exported function NewECBDecrypter should have comment or be unexported (golint)
    • toolkit/util/container/injector.go
    • Line 75: warning: comment on exported function NewInjector should be of the form "NewInjector ..." (golint)
    • Line 140: warning: receiver name i should be consistent with previous receiver name inj for injector (golint)
    • Line 145: warning: receiver name i should be consistent with previous receiver name inj for injector (golint)
    • Line 152: warning: receiver name i should be consistent with previous receiver name inj for injector (golint)
    • Line 157: warning: receiver name i should be consistent with previous receiver name inj for injector (golint)
    • Line 184: warning: receiver name i should be consistent with previous receiver name inj for injector (golint)
    • toolkit/util/cache.go
    • Line 3: warning: exported type Cache should have comment or be unexported (golint)
    • Line 42: warning: exported type Callable should have comment or be unexported (golint)
    • Line 44: warning: exported function TryCache should have comment or be unexported (golint)
    • toolkit/util/timeutil/time.go
    • Line 7: warning: comment on exported function SetTimeout should be of the form "SetTimeout ..." (golint)
    • Line 15: warning: comment on exported function SetInterval should be of the form "SetInterval ..." (golint)
    • Line 28: warning: comment on exported function Nanosecond should be of the form "Nanosecond ..." (golint)
    • Line 33: warning: comment on exported function Microsecond should be of the form "Microsecond ..." (golint)
    • Line 38: warning: comment on exported function Millisecond should be of the form "Millisecond ..." (golint)
    • Line 43: warning: comment on exported function Second should be of the form "Second ..." (golint)
    • Line 48: warning: comment on exported function Date should be of the form "Date ..." (golint)
    • Line 53: warning: comment on exported function Datetime should be of the form "Datetime ..." (golint)
    • Line 58: warning: comment on exported function Format should be of the form "Format ..." (golint)
    • Line 68: warning: comment on exported function StrToTime should be of the form "StrToTime ..." (golint)
    • toolkit/util/container/list.go
    • Line 8: warning: comment on exported type List should be of the form "List ..." (with optional leading article) (golint)
    • Line 14: warning: comment on exported function NewList should be of the form "NewList ..." (golint)
    • Line 19: warning: comment on exported method List.PushFront should be of the form "PushFront ..." (golint)
    • Line 20: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 27: warning: comment on exported method List.PushBack should be of the form "PushBack ..." (golint)
    • Line 28: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 35: warning: comment on exported method List.InsertAfter should be of the form "InsertAfter ..." (golint)
    • Line 36: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 43: warning: comment on exported method List.InsertBefore should be of the form "InsertBefore ..." (golint)
    • Line 44: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 51: warning: comment on exported method List.BatchPushFront should be of the form "BatchPushFront ..." (golint)
    • Line 52: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 60: warning: comment on exported method List.PopBack should be of the form "PopBack ..." (golint)
    • Line 61: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 72: warning: comment on exported method List.PopFront should be of the form "PopFront ..." (golint)
    • Line 73: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 84: warning: comment on exported method List.BatchPopBack should be of the form "BatchPopBack ..." (golint)
    • Line 85: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 104: warning: comment on exported method List.BatchPopFront should be of the form "BatchPopFront ..." (golint)
    • Line 105: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 124: warning: comment on exported method List.PopBackAll should be of the form "PopBackAll ..." (golint)
    • Line 125: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 140: warning: comment on exported method List.PopFrontAll should be of the form "PopFrontAll ..." (golint)
    • Line 141: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 156: warning: comment on exported method List.Remove should be of the form "Remove ..." (golint)
    • Line 157: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 164: warning: comment on exported method List.RemoveAll should be of the form "RemoveAll ..." (golint)
    • Line 165: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 171: warning: comment on exported method List.FrontAll should be of the form "FrontAll ..." (golint)
    • Line 172: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 188: warning: comment on exported method List.BackAll should be of the form "BackAll ..." (golint)
    • Line 189: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 205: warning: comment on exported method List.FrontItem should be of the form "FrontItem ..." (golint)
    • Line 206: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 217: warning: comment on exported method List.BackItem should be of the form "BackItem ..." (golint)
    • Line 218: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 229: warning: comment on exported method List.Front should be of the form "Front ..." (golint)
    • Line 230: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 237: warning: comment on exported method List.Back should be of the form "Back ..." (golint)
    • Line 238: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 245: warning: comment on exported method List.Len should be of the form "Len ..." (golint)
    • Line 246: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • toolkit/util/container/map.go
    • Line 6: warning: exported method Map.Set should have comment or be unexported (golint)
    • Line 10: warning: exported method Map.Get should have comment or be unexported (golint)
    • Line 17: warning: exported method Map.Delete should have comment or be unexported (golint)
    • toolkit/filter/metrics.go
    • Line 32: warning: exported function GetPrometheusLogHandler should have comment or be unexported (golint)
    • Line 44: warning: exported function Metrics should have comment or be unexported (golint)
    • toolkit/util/strings/size.go
    • Line 10: warning: exported const Byte should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported function ParseByteSize should have comment or be unexported (golint)
    • toolkit/util/locker.go
    • Line 9: warning: exported type Locker should have comment or be unexported (golint)
    • Line 14: warning: exported type RedisLocker should have comment or be unexported (golint)
    • Line 19: warning: exported function NewRedisLocker should have comment or be unexported (golint)
    • Line 23: warning: exported method RedisLocker.Lock should have comment or be unexported (golint)
    • Line 37: warning: exported method RedisLocker.Unlock should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell94%

Misspell Finds commonly misspelled English words