Preparing report...

Report for github.com/rrylee/go-tinyid

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


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!


golint20%

Golint is a linter for Go source code.

    • go-tinyid/server/service/db_segmentId_service.go
    • Line 13: warning: exported type DbSegmentIdService should have comment or be unexported (golint)
    • Line 16: warning: exported method DbSegmentIdService.GetNextSegmentId should have comment or be unexported (golint)
    • Line 32: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-tinyid/core/cacheid_generator.go
    • Line 9: warning: exported type SegmentIdService should have comment or be unexported (golint)
    • Line 13: warning: exported type CacheIdGenerator should have comment or be unexported (golint)
    • Line 36: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 46: warning: exported method CacheIdGenerator.NextId should have comment or be unexported (golint)
    • Line 70: warning: exported method CacheIdGenerator.GetCurrentSegmentId should have comment or be unexported (golint)
    • Line 74: warning: exported method CacheIdGenerator.GetNextSegmentId should have comment or be unexported (golint)
    • Line 78: warning: exported method CacheIdGenerator.NextBatchIds should have comment or be unexported (golint)
    • Line 117: warning: exported function NewCacheIdGenerator should have comment or be unexported (golint)
    • go-tinyid/core/entity/idresult.go
    • Line 3: warning: exported type ResultCode should have comment or be unexported (golint)
    • Line 6: warning: exported const Over should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type IdResult should have comment or be unexported (golint)
    • go-tinyid/core/idgenerator_factory.go
    • Line 5: warning: exported type IdGeneratorFactory should have comment or be unexported (golint)
    • Line 11: warning: exported function NewIdGeneratorFactory should have comment or be unexported (golint)
    • Line 18: warning: exported method IdGeneratorFactory.GetGenerator should have comment or be unexported (golint)
    • go-tinyid/constant/errorcode.go
    • Line 3: warning: exported type ErrorCode should have comment or be unexported (golint)
    • Line 8: warning: exported var BizTypeErr should have comment or be unexported (golint)
    • Line 9: warning: exported var TokenErr should have comment or be unexported (golint)
    • Line 10: warning: exported var SysErr should have comment or be unexported (golint)
    • go-tinyid/server/dbconnection/mysql/init.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: exported function GetConn should have comment or be unexported (golint)
    • Line 24: warning: exported function Init should have comment or be unexported (golint)
    • go-tinyid/client/client.go
    • Line 8: warning: exported type TinyIdClient should have comment or be unexported (golint)
    • Line 11: warning: exported function Init should have comment or be unexported (golint)
    • Line 15: warning: exported method TinyIdClient.NextId should have comment or be unexported (golint)
    • Line 23: warning: exported method TinyIdClient.NextBatchIds should have comment or be unexported (golint)
    • go-tinyid/server/dao/tinyidinfo_dao.go
    • Line 11: warning: exported const SelectSql should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported function QueryByBizType should have comment or be unexported (golint)
    • Line 27: warning: exported function UpdateMaxId should have comment or be unexported (golint)
    • go-tinyid/core/entity/segmentid.go
    • Line 9: warning: exported type SegmentId should have comment or be unexported (golint)
    • Line 19: warning: exported method SegmentId.CurrentId should have comment or be unexported (golint)
    • Line 23: warning: exported method SegmentId.Delta should have comment or be unexported (golint)
    • Line 27: warning: exported method SegmentId.Remainder should have comment or be unexported (golint)
    • Line 31: warning: exported method SegmentId.LoadingId should have comment or be unexported (golint)
    • Line 35: warning: exported method SegmentId.MaxId should have comment or be unexported (golint)
    • Line 39: warning: exported function NewSegmentId should have comment or be unexported (golint)
    • Line 50: warning: exported method SegmentId.NextId should have comment or be unexported (golint)
    • Line 92: warning: exported method SegmentId.Useful should have comment or be unexported (golint)
    • go-tinyid/server/http/handler.go
    • Line 14: warning: exported type Response should have comment or be unexported (golint)
    • Line 59: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 108: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-tinyid/internal/log.go
    • Line 8: warning: exported var Logger should have comment or be unexported (golint)
    • Line 10: warning: exported function Logf should have comment or be unexported (golint)
    • Line 17: warning: exported function Warnf 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!