Preparing report...

Report for github.com/winjeg/go-commons

A+    Excellent!    Found 17 issues across 38 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo97%

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.


golint55%

Golint is a linter for Go source code.

    • go-commons/cryptos/base64.go
    • Line 5: warning: comment on exported function Base64Encrypt should be of the form "Base64Encrypt ..." (golint)
    • Line 15: warning: comment on exported function Base64Decrypt should be of the form "Base64Decrypt ..." (golint)
    • go-commons/openapi/postgres_provider.go
    • Line 14: warning: comment on exported type PgSqlSecretKeeper should be of the form "PgSqlSecretKeeper ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported method PgSqlSecretKeeper.GetSecret should be of the form "GetSecret ..." (golint)
    • Line 41: warning: exported method PgSqlSecretKeeper.GeneratePair should have comment or be unexported (golint)
    • go-commons/str/str.go
    • Line 14: warning: comment on exported const KindNumber should be of the form "KindNumber ..." (golint)
    • Line 16: warning: comment on exported const KindLower should be of the form "KindLower ..." (golint)
    • Line 18: warning: comment on exported const KindUpper should be of the form "KindUpper ..." (golint)
    • Line 20: warning: comment on exported const KindAll should be of the form "KindAll ..." (golint)
    • Line 22: warning: comment on exported const KindAllWithSpecial should be of the form "KindAllWithSpecial ..." (golint)
    • Line 26: warning: comment on exported function RandStr should be of the form "RandStr ..." (golint)
    • Line 54: warning: comment on exported function RandomNumAlphabets should be of the form "RandomNumAlphabets ..." (golint)
    • Line 60: warning: comment on exported function RandomNumbers should be of the form "RandomNumbers ..." (golint)
    • Line 66: warning: comment on exported function RandomAlphabetsLower should be of the form "RandomAlphabetsLower ..." (golint)
    • Line 72: warning: comment on exported function RandomAlphabetsUpper should be of the form "RandomAlphabetsUpper ..." (golint)
    • Line 78: warning: comment on exported function RandomStrWithSpecialChars should be of the form "RandomStrWithSpecialChars ..." (golint)
    • Line 84: warning: comment on exported function UUID should be of the form "UUID ..." (golint)
    • Line 91: warning: comment on exported function UUIDShort should be of the form "UUIDShort ..." (golint)
    • Line 102: warning: comment on exported function IsEmpty should be of the form "IsEmpty ..." (golint)
    • Line 108: warning: comment on exported function IsBlank should be of the form "IsBlank ..." (golint)
    • Line 114: warning: comment on exported function IsAllBlank should be of the form "IsAllBlank ..." (golint)
    • Line 125: warning: comment on exported function ReplaceAll should be of the form "ReplaceAll ..." (golint)
    • Line 131: warning: comment on exported function TrimComma should be of the form "TrimComma ..." (golint)
    • Line 136: warning: comment on exported function TrimDot should be of the form "TrimDot ..." (golint)
    • Line 141: warning: comment on exported function Trim should be of the form "Trim ..." (golint)
    • Line 155: warning: comment on exported function Join should be of the form "Join ..." (golint)
    • Line 160: warning: comment on exported function ToBytes should be of the form "ToBytes ..." (golint)
    • Line 167: warning: comment on exported function FromBytes should be of the form "FromBytes ..." (golint)
    • Line 172: warning: comment on exported function JoinInt should be of the form "JoinInt ..." (golint)
    • Line 184: warning: comment on exported function SplitInt should be of the form "SplitInt ..." (golint)
    • Line 201: warning: exported function SplitInt64 should have comment or be unexported (golint)
    • Line 217: warning: comment on exported function JoinIfNotEmpty should be of the form "JoinIfNotEmpty ..." (golint)
    • go-commons/log/log.go
    • Line 34: warning: exported type LogSettings should have comment or be unexported (golint)
    • Line 36: warning: exported type Settings should have comment or be unexported (golint)
    • Line 44: warning: comment on exported function GetLogger should be of the form "GetLogger ..." (golint)
    • Line 55: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 59: warning: exported function IgnoreErrors should have comment or be unexported (golint)
    • Line 65: warning: exported function Errors should have comment or be unexported (golint)
    • go-commons/openapi/mysql_provider.go
    • Line 25: warning: comment on exported type SqlSecretKeeper should be of the form "SqlSecretKeeper ..." (with optional leading article) (golint)
    • Line 33: warning: comment on exported method SqlSecretKeeper.GetSecret should be of the form "GetSecret ..." (golint)
    • Line 52: warning: exported method SqlSecretKeeper.GeneratePair should have comment or be unexported (golint)
    • go-commons/uid/id_generator.go
    • Line 26: warning: exported function NextID should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function UUID should be of the form "UUID ..." (golint)
    • Line 42: warning: comment on exported function UUIDShort should be of the form "UUIDShort ..." (golint)
    • go-commons/cryptos/md5.go
    • Line 11: warning: exported function MD5 should have comment or be unexported (golint)
    • Line 16: warning: exported function StrMD5 should have comment or be unexported (golint)
    • go-commons/props/props.go
    • Line 17: warning: comment on exported type Properties should be of the form "Properties ..." (with optional leading article) (golint)
    • Line 48: warning: comment on exported function LoadFile should be of the form "LoadFile ..." (golint)
    • Line 60: warning: comment on exported function FromString should be of the form "FromString ..." (golint)
    • go-commons/openapi/client.go
    • Line 21: warning: exported type Client should have comment or be unexported (golint)
    • Line 26: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 30: warning: exported function DefaultClient should have comment or be unexported (golint)
    • Line 40: warning: exported method Client.Get should have comment or be unexported (golint)
    • Line 44: warning: exported method Client.Post should have comment or be unexported (golint)
    • Line 48: warning: exported method Client.Delete should have comment or be unexported (golint)
    • Line 52: warning: exported method Client.Put should have comment or be unexported (golint)
    • Line 111: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • go-commons/cache/cache.go
    • Line 58: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 84: warning: exported function Get should have comment or be unexported (golint)
    • Line 88: warning: exported function Set should have comment or be unexported (golint)
    • go-commons/settings/settings.go
    • Line 70: warning: exported function InitV2 should have comment or be unexported (golint)
    • Line 74: warning: exported function InitV3 should have comment or be unexported (golint)
    • Line 85: warning: exported function Init should have comment or be unexported (golint)
    • Line 123: warning: exported function GetVar should have comment or be unexported (golint)
    • Line 126: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 147: warning: comment on exported function SetVar should be of the form "SetVar ..." (golint)
    • Line 215: warning: exported function DelVar should have comment or be unexported (golint)
    • go-commons/http/http_client.go
    • Line 25: warning: comment on exported function GetWithParams should be of the form "GetWithParams ..." (golint)
    • Line 56: warning: exported function GetWithHeader should have comment or be unexported (golint)
    • Line 69: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 118: warning: comment on exported function Delete should be of the form "Delete ..." (golint)
    • Line 144: warning: comment on exported function DoRequest should be of the form "DoRequest ..." (golint)
    • go-commons/log/config.go
    • Line 11: warning: exported type RotateFileConfig should have comment or be unexported (golint)
    • Line 21: warning: exported type RotateFileHook should have comment or be unexported (golint)
    • Line 26: warning: exported function NewRotateFileHook should have comment or be unexported (golint)
    • Line 39: warning: exported method RotateFileHook.Levels should have comment or be unexported (golint)
    • Line 43: warning: exported method RotateFileHook.Fire should have comment or be unexported (golint)
    • go-commons/openapi/secret.go
    • Line 3: warning: comment on exported type SecretKeeper should be of the form "SecretKeeper ..." (with optional leading article) (golint)
    • Line 9: warning: exported const EmptyString should have comment (or a comment on this block) 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!