Preparing report...

Report for github.com/xinpianchang/xservice

A+    Excellent!    Found 31 issues across 74 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!


gocyclo98%

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.


golint58%

Golint is a linter for Go source code.

    • xservice/pkg/cronx/cron.go
    • Line 16: warning: exported const SpecManual should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported function Add should have comment or be unexported (golint)
    • xservice/pkg/echox/timestamp.go
    • Line 13: warning: exported type Timestamp should have comment or be unexported (golint)
    • Line 38: warning: exported method Timestamp.UnmarshalJSON should have comment or be unexported (golint)
    • Line 61: warning: comment on exported method Timestamp.Value should be of the form "Value ..." (golint)
    • Line 66: warning: comment on exported method Timestamp.Scan should be of the form "Scan ..." (golint)
    • xservice/core/const.go
    • Line 7: warning: comment on exported const ContextHeaderXRequestID should be of the form "ContextHeaderXRequestID ..." (golint)
    • Line 10: warning: exported const DefaultServiceName should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: comment on exported const EnvServiceName should be of the form "EnvServiceName ..." (golint)
    • Line 20: warning: comment on exported const ConfigServiceAddr should be of the form "ConfigServiceAddr ..." (golint)
    • xservice/pkg/echox/cache.go
    • Line 10: warning: exported function Cache should have comment or be unexported (golint)
    • Line 19: warning: exported function NoCache should have comment or be unexported (golint)
    • xservice/pkg/echox/validator.go
    • Line 18: warning: exported type EchoValidator should have comment or be unexported (golint)
    • Line 23: warning: exported method EchoValidator.Validate should have comment or be unexported (golint)
    • Line 27: warning: exported method EchoValidator.Bind should have comment or be unexported (golint)
    • xservice/pkg/log/echo_logger.go
    • Line 45: warning: comment on exported method EchoLogger.SetPrefix should be of the form "SetPrefix ..." (golint)
    • Line 56: warning: comment on exported method EchoLogger.SetLevel should be of the form "SetLevel ..." (golint)
    • xservice/tools/xservice/model/mysql/table.go
    • Line 17: warning: exported type Config should have comment or be unexported (golint)
    • Line 24: warning: exported type MySQLGenerator should have comment or be unexported (golint)
    • Line 29: warning: exported type Table should have comment or be unexported (golint)
    • Line 36: warning: exported type Field should have comment or be unexported (golint)
    • Line 112: warning: exported function NewMySQLGenerator should have comment or be unexported (golint)
    • Line 119: warning: exported method MySQLGenerator.Gen should have comment or be unexported (golint)
    • Line 639: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • xservice/example/grpc-service/server/main.go
    • Line 48: warning: exported type GreeterServer should have comment or be unexported (golint)
    • Line 50: warning: exported method GreeterServer.SayHello should have comment or be unexported (golint)
    • Line 54: warning: exported type CalculatorServer should have comment or be unexported (golint)
    • Line 56: warning: exported method CalculatorServer.AddInt should have comment or be unexported (golint)
    • xservice/pkg/gormx/config.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 22: warning: exported type DbConfig should have comment or be unexported (golint)
    • Line 32: warning: exported type ConfigureFn should have comment or be unexported (golint)
    • Line 110: warning: exported function Get should have comment or be unexported (golint)
    • xservice/pkg/requests/retry.go
    • Line 5: warning: comment on exported type RetryStrategy should be of the form "RetryStrategy ..." (with optional leading article) (golint)
    • Line 33: warning: comment on exported function LimitLinearRetry should be of the form "LimitLinearRetry ..." (golint)
    • xservice/pkg/grpcx/validate.go
    • Line 11: warning: exported type Validator should have comment or be unexported (golint)
    • Line 15: warning: exported function EnvoyproxyValidatorStreamServerInterceptor should have comment or be unexported (golint)
    • Line 26: warning: exported function EnvoyproxyValidatorUnaryServerInterceptor should have comment or be unexported (golint)
    • xservice/pkg/signalx/shutdown_hook.go
    • Line 15: warning: exported type ShutdownHook should have comment or be unexported (golint)
    • Line 17: warning: exported function AddShutdownHook should have comment or be unexported (golint)
    • Line 23: warning: exported function ShutdownListen should have comment or be unexported (golint)
    • xservice/pkg/iox/textlinescanner.go
    • Line 9: warning: exported type TextLineScanner should have comment or be unexported (golint)
    • Line 16: warning: exported function NewTextLineScanner should have comment or be unexported (golint)
    • Line 23: warning: exported method TextLineScanner.Scan should have comment or be unexported (golint)
    • Line 40: warning: exported method TextLineScanner.Line should have comment or be unexported (golint)
    • xservice/pkg/redisx/config.go
    • Line 23: warning: exported var Locker should have comment or be unexported (golint)
    • Line 40: warning: exported function Config should have comment or be unexported (golint)
    • Line 109: warning: exported function GetClient should have comment or be unexported (golint)
    • Line 113: warning: exported function NewLocker should have comment or be unexported (golint)
    • Line 117: warning: exported function Key should have comment or be unexported (golint)
    • Line 124: warning: exported type ClientWrapper should have comment or be unexported (golint)
    • Line 128: warning: exported function Get should have comment or be unexported (golint)
    • Line 132: warning: exported method ClientWrapper.Key should have comment or be unexported (golint)
    • Line 136: warning: exported method ClientWrapper.Obtain should have comment or be unexported (golint)
    • xservice/pkg/iox/copy.go
    • Line 11: warning: comment on exported function CopyFile should be of the form "CopyFile ..." (golint)
    • Line 37: warning: exported function CopyDir 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!