Preparing report...

Report for github.com/learninto/go-utils

A+    Excellent!    Found 29 issues across 47 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!


gocyclo95%

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.


golint44%

Golint is a linter for Go source code.

    • go-utils/test/mock/httpmock.go
    • Line 9: warning: exported function ActivateHttpMock should have comment or be unexported (golint)
    • Line 13: warning: exported function DeactivateHttpMock should have comment or be unexported (golint)
    • Line 17: warning: exported function NewBytesResponder should have comment or be unexported (golint)
    • Line 21: warning: exported function NewStringResponder should have comment or be unexported (golint)
    • Line 25: warning: exported function NewStringResponse should have comment or be unexported (golint)
    • Line 29: warning: exported function NewJsonResponse should have comment or be unexported (golint)
    • Line 33: warning: exported function RegisterHttpResponder should have comment or be unexported (golint)
    • go-utils/twirp/context.go
    • Line 27: warning: exported const MethodNameKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 153: warning: exported function HTTPRequestHeaders should have comment or be unexported (golint)
    • go-utils/conf/conf.go
    • Line 100: warning: exported type Conf should have comment or be unexported (golint)
    • Line 106: warning: exported method Conf.GetFloat64 should have comment or be unexported (golint)
    • Line 112: warning: exported method Conf.Get should have comment or be unexported (golint)
    • Line 118: warning: exported method Conf.GetStrings should have comment or be unexported (golint)
    • Line 133: warning: exported method Conf.GetInt32s should have comment or be unexported (golint)
    • Line 143: warning: exported method Conf.GetInt64s should have comment or be unexported (golint)
    • Line 162: warning: exported method Conf.GetInt should have comment or be unexported (golint)
    • Line 168: warning: exported method Conf.GetInt32 should have comment or be unexported (golint)
    • Line 174: warning: exported method Conf.GetInt64 should have comment or be unexported (golint)
    • Line 180: warning: exported method Conf.GetDuration should have comment or be unexported (golint)
    • Line 191: warning: exported method Conf.GetTime should have comment or be unexported (golint)
    • Line 203: warning: exported method Conf.GetBool should have comment or be unexported (golint)
    • Line 209: warning: exported method Conf.Set should have comment or be unexported (golint)
    • go-utils/xhttp/grpc.go
    • Line 18: warning: exported type GrpcClient should have comment or be unexported (golint)
    • Line 29: warning: exported function NewGrpcClient should have comment or be unexported (golint)
    • go-utils/twirp/hooks_test.go
    • Line 32: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 36: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 40: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 44: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 48: warning: should not use basic type string as key in context.WithValue (golint)
    • go-utils/test/assert/assert.go
    • Line 9: warning: exported function Contains should have comment or be unexported (golint)
    • Line 13: warning: exported function Empty should have comment or be unexported (golint)
    • Line 17: warning: exported function Equal should have comment or be unexported (golint)
    • Line 21: warning: exported function EqualError should have comment or be unexported (golint)
    • Line 25: warning: exported function EqualValues should have comment or be unexported (golint)
    • Line 29: warning: exported function False should have comment or be unexported (golint)
    • Line 33: warning: exported function Nil should have comment or be unexported (golint)
    • Line 37: warning: exported function NotEmpty should have comment or be unexported (golint)
    • Line 41: warning: exported function NotEqual should have comment or be unexported (golint)
    • Line 45: warning: exported function NotNil should have comment or be unexported (golint)
    • Line 49: warning: exported function True should have comment or be unexported (golint)
    • go-utils/xnsq/nsq.go
    • Line 5: warning: exported type Nsq should have comment or be unexported (golint)
    • Line 11: warning: exported function NewNsq should have comment or be unexported (golint)
    • go-utils/excelize/excelize.go
    • Line 9: warning: comment on exported function NewFile should be of the form "NewFile ..." (golint)
    • Line 14: warning: comment on exported function OpenFile should be of the form "OpenFile ..." (golint)
    • Line 19: warning: comment on exported function OpenReader should be of the form "OpenReader ..." (golint)
    • go-utils/jwt/jwt.go
    • Line 19: warning: comment on exported type CustomClaims should be of the form "CustomClaims ..." (with optional leading article) (golint)
    • Line 79: warning: comment on exported method JWT.ParseToken should be of the form "ParseToken ..." (golint)
    • Line 108: warning: comment on exported method JWT.RefreshToken should be of the form "RefreshToken ..." (golint)
    • go-utils/errors/errors.go
    • Line 15: warning: comment on exported var TokenExpired should be of the form "TokenExpired ..." (golint)
    • Line 18: warning: comment on exported var TokenNotValidYet should be of the form "TokenNotValidYet ..." (golint)
    • Line 21: warning: comment on exported var TokenMalformed should be of the form "TokenMalformed ..." (golint)
    • Line 24: warning: comment on exported var TokenInvalid should be of the form "TokenInvalid ..." (golint)
    • go-utils/twirp/ctxsetters.go
    • Line 14: warning: package comment should be of the form "Package twirp ..." (golint)
    • Line 29: warning: exported function WithMethodName should have comment or be unexported (golint)
    • Line 33: warning: exported function WithServiceName should have comment or be unexported (golint)
    • Line 37: warning: exported function WithPackageName should have comment or be unexported (golint)
    • Line 41: warning: exported function WithStatusCode should have comment or be unexported (golint)
    • Line 45: warning: exported function WithResponseWriter should have comment or be unexported (golint)
    • Line 49: warning: exported function WithHttpRequest should have comment or be unexported (golint)
    • Line 53: warning: exported function WithRequest should have comment or be unexported (golint)
    • Line 57: warning: exported function WithResponse should have comment or be unexported (golint)
    • Line 61: warning: exported function WithMethodOption should have comment or be unexported (golint)
    • go-utils/test/mock/patch.go
    • Line 9: warning: exported function Patch should have comment or be unexported (golint)
    • Line 13: warning: exported function PatchInstanceMethod should have comment or be unexported (golint)
    • Line 17: warning: exported function Unpatch should have comment or be unexported (golint)
    • Line 21: warning: exported function UnpatchInstanceMethod should have comment or be unexported (golint)
    • Line 25: warning: exported function UnpatchAll should have comment or be unexported (golint)
    • go-utils/db/c.go
    • Line 10: warning: comment on exported type C should be of the form "C ..." (with optional leading article) (golint)
    • Line 17: warning: exported method C.BuildSQL should have comment or be unexported (golint)
    • Line 85: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • go-utils/sniper.go
    • Line 21: warning: exported function PrometheusHandleFunc should have comment or be unexported (golint)
    • Line 35: warning: exported function Ping should have comment or be unexported (golint)
    • Line 55: warning: comment on exported type PanicHandler should be of the form "PanicHandler ..." (with optional leading article) (golint)
    • go-utils/ctxkit/ctxkit.go
    • Line 51: warning: comment on exported const CompanyAppKeyKey should be of the form "CompanyAppKeyKey ..." (golint)
    • Line 55: warning: comment on exported const TSKey should be of the form "TSKey ..." (golint)
    • Line 132: warning: comment on exported function WithDepartmentIds should be of the form "WithDepartmentIds ..." (golint)
    • Line 153: warning: exported function WithUserIP should have comment or be unexported (golint)
    • Line 169: warning: exported function WithPlatform should have comment or be unexported (golint)
    • Line 223: warning: exported function WithVersion should have comment or be unexported (golint)
    • Line 261: warning: exported function GetSign should have comment or be unexported (golint)
    • Line 268: warning: comment on exported function WithSignKey should be of the form "WithSignKey ..." (golint)
    • go-utils/xjson/json.go
    • Line 5: warning: exported function Unmarshal should have comment or be unexported (golint)
    • Line 10: warning: exported function Marshal should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!