Preparing report...

Report for github.com/xgxw/foundation-go

A+    Excellent!    Found 22 issues across 39 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!


golint46%

Golint is a linter for Go source code.

    • foundation-go/caches/redis.go
    • Line 17: warning: exported type RedisOptions should have comment or be unexported (golint)
    • Line 34: warning: exported type RedisCache should have comment or be unexported (golint)
    • Line 40: warning: exported function NewRedisCache should have comment or be unexported (golint)
    • Line 57: warning: exported method RedisCache.Get should have comment or be unexported (golint)
    • Line 68: warning: exported method RedisCache.Set should have comment or be unexported (golint)
    • Line 76: warning: exported method RedisCache.Delete should have comment or be unexported (golint)
    • Line 84: warning: exported method RedisCache.IncrBy should have comment or be unexported (golint)
    • Line 92: warning: exported method RedisCache.Exists should have comment or be unexported (golint)
    • Line 100: warning: exported method RedisCache.Redis should have comment or be unexported (golint)
    • foundation-go/messages/aliyun.go
    • Line 14: warning: exported const BaseURL should have comment or be unexported (golint)
    • Line 17: warning: exported type AliClient should have comment or be unexported (golint)
    • Line 20: warning: exported type AliMessageOptions should have comment or be unexported (golint)
    • Line 26: warning: exported function NewAliClient should have comment or be unexported (golint)
    • Line 39: warning: exported method AliClient.Send should have comment or be unexported (golint)
    • foundation-go/log/ctx.go
    • Line 17: warning: exported var NullLogger should have comment or be unexported (golint)
    • Line 24: warning: exported function SetDebugOutput should have comment or be unexported (golint)
    • Line 28: warning: exported function Extract should have comment or be unexported (golint)
    • Line 36: warning: exported function ToContext should have comment or be unexported (golint)
    • Line 40: warning: exported function Debugf should have comment or be unexported (golint)
    • foundation-go/log/log.go
    • Line 37: warning: comment on exported function NewLogger should be of the form "NewLogger ..." (golint)
    • Line 74: warning: exported method Logger.WithScope should have comment or be unexported (golint)
    • Line 78: warning: exported method Logger.WithField should have comment or be unexported (golint)
    • Line 82: warning: exported method Logger.WithFields should have comment or be unexported (golint)
    • foundation-go/events/manager.go
    • Line 33: warning: exported type KafkaManagerOptions should have comment or be unexported (golint)
    • Line 235: warning: exported method KafkaManager.ProducerErrors should have comment or be unexported (golint)
    • Line 239: warning: exported method KafkaManager.ConsumerErrors should have comment or be unexported (golint)
    • foundation-go/log/entry.go
    • Line 14: warning: exported function NewEntry should have comment or be unexported (golint)
    • Line 18: warning: exported type RequestProtocol should have comment or be unexported (golint)
    • Line 21: warning: exported const ProtocolHTTP should have comment (or a comment on this block) or be unexported (golint)
    • Line 73: warning: exported method Entry.WithProcessMetricsFields should have comment or be unexported (golint)
    • foundation-go/storages/oss.go
    • Line 91: warning: exported method OSSStorage.Name should have comment or be unexported (golint)
    • Line 95: warning: exported method OSSStorage.Save should have comment or be unexported (golint)
    • Line 99: warning: comment on exported method OSSStorage.Fetch should be of the form "Fetch ..." (golint)
    • Line 109: warning: exported method OSSStorage.Del should have comment or be unexported (golint)
    • Line 113: warning: exported method OSSStorage.URL should have comment or be unexported (golint)
    • foundation-go/event.go
    • Line 7: warning: exported type Event should have comment or be unexported (golint)
    • Line 12: warning: exported type EventOptions should have comment or be unexported (golint)
    • Line 17: warning: exported type EventPublishOption should have comment or be unexported (golint)
    • Line 19: warning: exported type EventHandler should have comment or be unexported (golint)
    • Line 21: warning: exported type EventManager should have comment or be unexported (golint)
    • Line 29: warning: exported type EventInspector should have comment or be unexported (golint)
    • foundation-go/helper/sqlbuilder/sqlbuilder.go
    • Line 15: warning: exported const DefaultTag should have comment or be unexported (golint)
    • Line 17: warning: exported type SQLBuilder should have comment or be unexported (golint)
    • Line 19: warning: exported function NewSQLBuilder should have comment or be unexported (golint)
    • Line 23: warning: comment on exported method SQLBuilder.InsertSQL should be of the form "InsertSQL ..." (golint)
    • Line 31: warning: exported method SQLBuilder.InsertSQLByGORM should have comment or be unexported (golint)
    • Line 35: warning: exported method SQLBuilder.InsertSQLCustom should have comment or be unexported (golint)
    • foundation-go/message.go
    • Line 8: warning: exported type MessageTemplate should have comment or be unexported (golint)
    • Line 16: warning: exported type Message should have comment or be unexported (golint)
    • foundation-go/events/consumer.go
    • Line 93: warning: exported method KafkaConsumer.SetBatchConsumptionSize should have comment or be unexported (golint)
    • Line 98: warning: exported method KafkaConsumer.SetBatchConsumptionHandleTimeout 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.


misspell97%

Misspell Finds commonly misspelled English words

    • foundation-go/errors/errors.go
    • Line 10: warning: "Unkown" is a misspelling of "Unknown" (misspell)
    • Line 11: warning: "Unkown" is a misspelling of "Unknown" (misspell)
    • Line 11: warning: "unkown" is a misspelling of "unknown" (misspell)
    • Line 53: warning: "Unkown" is a misspelling of "Unknown" (misspell)