Preparing report...

Report for github.com/dipperin/go-ms-toolkit

A    Great!    Found 50 issues across 62 files

Tweet

gofmt72%

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!


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.


golint27%

Golint is a linter for Go source code.

    • go-ms-toolkit/mq/nsq/consumer.go
    • Line 14: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 27: warning: comment on exported function NewConsumer should be of the form "NewConsumer ..." (golint)
    • Line 39: warning: exported method Consumer.SetLogger should have comment or be unexported (golint)
    • Line 44: warning: exported method Consumer.SetMap should have comment or be unexported (golint)
    • Line 50: warning: exported method Consumer.Set should have comment or be unexported (golint)
    • Line 84: warning: exported method Consumer.Start should have comment or be unexported (golint)
    • Line 122: warning: comment on exported method Consumer.Stop should be of the form "Stop ..." (golint)
    • go-ms-toolkit/mq/nsq/receiver.go
    • Line 10: warning: exported type MqReceiver should have comment or be unexported (golint)
    • Line 17: warning: exported type NsqReceiver should have comment or be unexported (golint)
    • Line 23: warning: exported function NewNsqReceiver should have comment or be unexported (golint)
    • Line 28: warning: exported method NsqReceiver.AddTask should have comment or be unexported (golint)
    • Line 35: warning: exported method NsqReceiver.BaseHost should have comment or be unexported (golint)
    • Line 48: warning: exported method NsqReceiver.Start should have comment or be unexported (golint)
    • Line 62: warning: exported method NsqReceiver.Stop should have comment or be unexported (golint)
    • Line 68: warning: exported type MqHostConfigs should have comment or be unexported (golint)
    • Line 72: warning: exported type MqTaskConfigs should have comment or be unexported (golint)
    • Line 80: warning: exported type MqTask should have comment or be unexported (golint)
    • Line 87: warning: exported method MqHostConfigs.IsValid should have comment or be unexported (golint)
    • Line 96: warning: exported function NewNsqTask should have comment or be unexported (golint)
    • Line 100: warning: exported type NsqTask should have comment or be unexported (golint)
    • go-ms-toolkit/orm/gorm/mysql/util.go
    • Line 7: warning: comment on exported function GetOffset should be of the form "GetOffset ..." (golint)
    • Line 15: warning: comment on exported function GetDataByPageAndPerPage should be of the form "GetDataByPageAndPerPage ..." (golint)
    • go-ms-toolkit/msproxy/requester_impl_resty.go
    • Line 10: warning: exported type RestyRequester should have comment or be unexported (golint)
    • Line 15: warning: exported method RestyRequester.Post should have comment or be unexported (golint)
    • Line 37: warning: exported function NewRestyRequester should have comment or be unexported (golint)
    • go-ms-toolkit/json/gjson-util/util.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 9: warning: exported var ErrInvalidValueTypeInJson should have comment or be unexported (golint)
    • Line 12: warning: comment on exported function GetInt should be of the form "GetInt ..." (golint)
    • Line 21: warning: exported function GetFloat should have comment or be unexported (golint)
    • Line 29: warning: exported function GetString should have comment or be unexported (golint)
    • Line 37: warning: exported function GetStringArr should have comment or be unexported (golint)
    • Line 51: warning: exported function GetBool should have comment or be unexported (golint)
    • Line 62: warning: exported function GetArray should have comment or be unexported (golint)
    • go-ms-toolkit/mq/nsq/nsq_writer.go
    • Line 12: warning: exported type NsqWriter should have comment or be unexported (golint)
    • Line 19: warning: exported type BaseNsqWriter should have comment or be unexported (golint)
    • Line 24: warning: exported function NewNsqWriter should have comment or be unexported (golint)
    • Line 42: warning: exported method BaseNsqWriter.Stop should have comment or be unexported (golint)
    • Line 48: warning: exported method BaseNsqWriter.Refresh should have comment or be unexported (golint)
    • Line 56: warning: exported method BaseNsqWriter.Publish should have comment or be unexported (golint)
    • Line 63: warning: exported method BaseNsqWriter.PublishString should have comment or be unexported (golint)
    • go-ms-toolkit/orm/gorm/mysql/batch_insert.go
    • Line 14: warning: comment on exported function DoBatchInsert should be of the form "DoBatchInsert ..." (golint)
    • Line 25: warning: comment on exported function NewBatchInsertSql should be of the form "NewBatchInsertSql ..." (golint)
    • Line 34: warning: comment on exported type BatchInsertSql should be of the form "BatchInsertSql ..." (with optional leading article) (golint)
    • Line 44: warning: exported method BatchInsertSql.Add should have comment or be unexported (golint)
    • Line 60: warning: exported method BatchInsertSql.ResultSql should have comment or be unexported (golint)
    • Line 135: warning: comment on exported function ClearData4str should be of the form "ClearData4str ..." (golint)
    • Line 144: warning: comment on exported function StrSliceContains should be of the form "StrSliceContains ..." (golint)
    • Line 154: warning: comment on exported function EnumAnObjFieldNames should be of the form "EnumAnObjFieldNames ..." (golint)
    • go-ms-toolkit/log/log.go
    • Line 17: warning: exported var QyLogger should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function InitLoggerWithCaller should be of the form "InitLoggerWithCaller ..." (golint)
    • Line 45: warning: comment on exported function InitLogger should be of the form "InitLogger ..." (golint)
    • Line 55: warning: exported function LoggerEnd should have comment or be unexported (golint)
    • go-ms-toolkit/msginrouter/srv.go
    • Line 12: warning: error var ParamsParseErr should have name of the form ErrFoo (golint)
    • Line 12: warning: exported var ParamsParseErr should have comment or be unexported (golint)
    • Line 15: warning: exported type R should have comment or be unexported (golint)
    • Line 20: warning: exported method R.AuthRg should have comment or be unexported (golint)
    • Line 24: warning: exported method R.Rg should have comment or be unexported (golint)
    • Line 28: warning: exported method R.SetAuthRg should have comment or be unexported (golint)
    • Line 32: warning: exported method R.SetRg should have comment or be unexported (golint)
    • Line 36: warning: exported method R.InitRouter should have comment or be unexported (golint)
    • Line 40: warning: exported method R.Handle should have comment or be unexported (golint)
    • Line 72: warning: exported type BaseResp should have comment or be unexported (golint)
    • go-ms-toolkit/mq/nsq/receiver_manager.go
    • Line 3: warning: exported type NsqHandler should have comment or be unexported (golint)
    • Line 7: warning: exported type NsqHandlerFunc should have comment or be unexported (golint)
    • Line 9: warning: exported method NsqHandlerFunc.TaskConfig should have comment or be unexported (golint)
    • Line 13: warning: exported type ReceiverManager should have comment or be unexported (golint)
    • Line 17: warning: exported function NewReceiverManager should have comment or be unexported (golint)
    • Line 23: warning: exported method ReceiverManager.Add should have comment or be unexported (golint)
    • Line 35: warning: exported method ReceiverManager.Start should have comment or be unexported (golint)
    • Line 39: warning: exported method ReceiverManager.Stop should have comment or be unexported (golint)
    • go-ms-toolkit/g-metrics/service.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 9: warning: comment on exported function NewPrometheusMetricsServer should be of the form "NewPrometheusMetricsServer ..." (golint)
    • Line 24: warning: exported type PrometheusMetricsServer should have comment or be unexported (golint)
    • Line 29: warning: exported method PrometheusMetricsServer.Start should have comment or be unexported (golint)
    • Line 44: warning: exported method PrometheusMetricsServer.Stop should have comment or be unexported (golint)
    • go-ms-toolkit/db-config/db_config.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported type DbConfig should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function NewDbConfig should be of the form "NewDbConfig ..." (golint)
    • Line 52: warning: exported function GetAppConfig should have comment or be unexported (golint)
    • Line 70: warning: comment on exported type AppConfig should be of the form "AppConfig ..." (with optional leading article) (golint)
    • Line 83: warning: comment on exported function GetAppDefaultConf should be of the form "GetAppDefaultConf ..." (golint)
    • Line 95: warning: comment on exported function GetDevDockerConf should be of the form "GetDevDockerConf ..." (golint)
    • Line 116: warning: comment on exported function GetProdDockerConf should be of the form "GetProdDockerConf ..." (golint)
    • go-ms-toolkit/qyenv/qy_env.go
    • Line 8: warning: exported function GetUseDocker should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function GetDockerEnv should be of the form "GetDockerEnv ..." (golint)
    • Line 40: warning: comment on exported function GetDBEnv should be of the form "GetDBEnv ..." (golint)
    • Line 45: warning: comment on exported function GetRunEnv should be of the form "GetRunEnv ..." (golint)
    • Line 50: warning: comment on exported function IsUnitTestEnv should be of the form "IsUnitTestEnv ..." (golint)
    • Line 55: warning: comment on exported function GetProductName should be of the form "GetProductName ..." (golint)
    • Line 60: warning: comment on exported function GetDeployName should be of the form "GetDeployName ..." (golint)
    • go-ms-toolkit/heath-check/grpc-healthcheck/healthcheck.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 14: warning: comment on exported function RegisterHealthCheck should be of the form "RegisterHealthCheck ..." (golint)
    • Line 25: warning: comment on exported function RegisterHealthCheckWithGin should be of the form "RegisterHealthCheckWithGin ..." (golint)
    • go-ms-toolkit/msginengine/option.go
    • Line 8: warning: exported type EngineOption should have comment or be unexported (golint)
    • Line 22: warning: exported function EnablePingCheck should have comment or be unexported (golint)
    • Line 28: warning: comment on exported function EnablePostBodyDecrypt should be of the form "EnablePostBodyDecrypt ..." (golint)
    • Line 39: warning: comment on exported function EnableJwtAuth should be of the form "EnableJwtAuth ..." (golint)
    • Line 47: warning: comment on exported function PrintReq should be of the form "PrintReq ..." (golint)
    • Line 54: warning: comment on exported function PrintResp should be of the form "PrintResp ..." (golint)
    • go-ms-toolkit/util/util.go
    • Line 10: warning: exported function GopathDir should have comment or be unexported (golint)
    • Line 18: warning: exported function HomeDir should have comment or be unexported (golint)
    • Line 28: warning: exported function FileExist should have comment or be unexported (golint)
    • Line 37: warning: exported function StringInSlice should have comment or be unexported (golint)
    • Line 46: warning: exported function ToCamelCase should have comment or be unexported (golint)
    • Line 56: warning: exported function StringContainsSliceByLower should have comment or be unexported (golint)
    • go-ms-toolkit/sentry-cli/client.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 13: warning: exported function Client should have comment or be unexported (golint)
    • Line 25: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-ms-toolkit/msproxy/srv.go
    • Line 9: warning: exported type Context should have comment or be unexported (golint)
    • Line 13: warning: exported type IProxyResp should have comment or be unexported (golint)
    • Line 19: warning: exported type Srv should have comment or be unexported (golint)
    • Line 23: warning: exported function NewSrv should have comment or be unexported (golint)
    • Line 27: warning: exported method Srv.PostProxy should have comment or be unexported (golint)
    • go-ms-toolkit/g-metrics/g_metrics.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 14: warning: exported function CreateCounter should have comment or be unexported (golint)
    • Line 35: warning: exported function CreateGauge should have comment or be unexported (golint)
    • Line 56: warning: exported function EnableMeter should have comment or be unexported (golint)
    • Line 60: warning: exported function Set should have comment or be unexported (golint)
    • Line 80: warning: exported function Add should have comment or be unexported (golint)
    • Line 106: warning: exported function Sub should have comment or be unexported (golint)
    • go-ms-toolkit/datamask/zap_tool.go
    • Line 9: warning: exported const Phone should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported function GetMark should have comment or be unexported (golint)
    • Line 34: warning: comment on exported function String should be of the form "String ..." (golint)
    • go-ms-toolkit/msproxy/proxy_resp_impl.go
    • Line 3: warning: exported type ProxyResp should have comment or be unexported (golint)
    • Line 9: warning: exported method ProxyResp.GetErrMsg should have comment or be unexported (golint)
    • Line 13: warning: exported method ProxyResp.GetData should have comment or be unexported (golint)
    • Line 17: warning: exported method ProxyResp.GetSuccess should have comment or be unexported (golint)
    • go-ms-toolkit/msginengine/http_engine.go
    • Line 24: warning: exported type IGRouter should have comment or be unexported (golint)
    • Line 30: warning: exported type Engine should have comment or be unexported (golint)
    • Line 36: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 41: warning: exported function ReleasesEngine should have comment or be unexported (golint)
    • Line 58: warning: exported method Engine.WithOptions should have comment or be unexported (golint)
    • Line 65: warning: exported method Engine.Start should have comment or be unexported (golint)
    • Line 73: warning: comment on exported method Engine.EasyCombine should be of the form "EasyCombine ..." (golint)
    • Line 87: warning: exported method Engine.NewRouterGroup should have comment or be unexported (golint)
    • Line 91: warning: exported method Engine.NewAuthRouterGroup should have comment or be unexported (golint)
    • go-ms-toolkit/json/json_util.go
    • Line 23: warning: comment on exported function StringifyJsonToBytes should be of the form "StringifyJsonToBytes ..." (golint)
    • Line 29: warning: exported function StringifyJsonToBytesWithErr 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!