Preparing report...

Report for github.com/SKF/go-utility

A+    Excellent!    Found 45 issues across 121 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!


golint62%

Golint is a linter for Go source code.

    • go-utility/array/array.go
    • Line 15: warning: exported function DistinctString should have comment or be unexported (golint)
    • Line 28: warning: exported function IntersectString should have comment or be unexported (golint)
    • Line 40: warning: exported function DifferenceString should have comment or be unexported (golint)
    • go-utility/v2/http-server/cache.go
    • Line 11: warning: exported function NewGeneralCacheKey should have comment or be unexported (golint)
    • Line 15: warning: exported function NewUserSpecificCacheKey should have comment or be unexported (golint)
    • go-utility/uuid/uuid.go
    • Line 8: warning: exported const EmptyUUID should have comment or be unexported (golint)
    • Line 10: warning: exported type UUID should have comment or be unexported (golint)
    • Line 17: warning: exported function IsValid should have comment or be unexported (golint)
    • Line 21: warning: exported method UUID.IsValid should have comment or be unexported (golint)
    • Line 25: warning: exported method UUID.Validate should have comment or be unexported (golint)
    • Line 34: warning: exported method UUID.StringPtr should have comment or be unexported (golint)
    • go-utility/jwk/jwk.go
    • Line 14: warning: exported var KeySetURL should have comment or be unexported (golint)
    • Line 17: warning: exported type JWKeySets should have comment or be unexported (golint)
    • Line 19: warning: exported method JWKeySets.LookupKeyID should have comment or be unexported (golint)
    • Line 39: warning: exported type JWKeySet should have comment or be unexported (golint)
    • Line 48: warning: exported method JWKeySet.GetPublicKey should have comment or be unexported (golint)
    • Line 77: warning: exported function GetKeySets should have comment or be unexported (golint)
    • Line 84: warning: exported function RefreshKeySets should have comment or be unexported (golint)
    • go-utility/v2/uuid/uuid.go
    • Line 8: warning: exported const EmptyUUID should have comment or be unexported (golint)
    • Line 10: warning: exported type UUID should have comment or be unexported (golint)
    • Line 17: warning: exported function IsValid should have comment or be unexported (golint)
    • Line 21: warning: exported method UUID.IsValid should have comment or be unexported (golint)
    • Line 25: warning: exported method UUID.Validate should have comment or be unexported (golint)
    • Line 34: warning: exported method UUID.StringPtr should have comment or be unexported (golint)
    • go-utility/v2/jwk/jwk.go
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 22: warning: exported function Configure should have comment or be unexported (golint)
    • Line 31: warning: exported type JWKeySets should have comment or be unexported (golint)
    • Line 33: warning: exported method JWKeySets.LookupKeyID should have comment or be unexported (golint)
    • Line 53: warning: exported type JWKeySet should have comment or be unexported (golint)
    • Line 64: warning: exported method JWKeySet.GetPublicKey should have comment or be unexported (golint)
    • Line 93: warning: exported function GetKeySets should have comment or be unexported (golint)
    • Line 101: warning: exported function RefreshKeySets should have comment or be unexported (golint)
    • go-utility/datadog/aws-cloudwatch-log-events/cloudwatch.go
    • Line 21: warning: exported type Processor should have comment or be unexported (golint)
    • Line 29: warning: exported function NewProcessor should have comment or be unexported (golint)
    • Line 37: warning: exported method Processor.Withtags should have comment or be unexported (golint)
    • Line 42: warning: exported method Processor.WithNoOfWorkers should have comment or be unexported (golint)
    • Line 47: warning: exported method Processor.Errors should have comment or be unexported (golint)
    • go-utility/v2/datadog/aws-cloudwatch-log-events/cloudwatch.go
    • Line 21: warning: exported type Processor should have comment or be unexported (golint)
    • Line 29: warning: exported function NewProcessor should have comment or be unexported (golint)
    • Line 37: warning: exported method Processor.Withtags should have comment or be unexported (golint)
    • Line 42: warning: exported method Processor.WithNoOfWorkers should have comment or be unexported (golint)
    • Line 47: warning: exported method Processor.Errors should have comment or be unexported (golint)
    • go-utility/v2/trace/http-headers.go
    • Line 4: warning: comment on exported const B3TraceIDHeader should be of the form "B3TraceIDHeader ..." (golint)
    • Line 6: warning: exported const B3SpanIDHeader should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: comment on exported const DatadogOriginHeader should be of the form "DatadogOriginHeader ..." (golint)
    • Line 17: warning: exported function AllHeaders should have comment or be unexported (golint)
    • Line 21: warning: exported function AllB3Headers should have comment or be unexported (golint)
    • Line 25: warning: exported function AllDatadogHeaders should have comment or be unexported (golint)
    • go-utility/v2/http-middleware/ratelimit/ratelimit.go
    • Line 19: warning: exported type ConnectionPool should have comment or be unexported (golint)
    • Line 23: warning: exported type Connection should have comment or be unexported (golint)
    • Line 29: warning: exported type Limit should have comment or be unexported (golint)
    • Line 34: warning: exported type Request should have comment or be unexported (golint)
    • Line 39: warning: exported type Limiter should have comment or be unexported (golint)
    • Line 46: warning: exported method Limiter.SetConnectionPool should have comment or be unexported (golint)
    • Line 51: warning: comment on exported method Limiter.Configure should be of the form "Configure ..." (golint)
    • Line 64: warning: comment on exported method Limiter.Middleware should be of the form "Middleware ..." (golint)
    • go-utility/v2/http-middleware/security.go
    • Line 26: warning: exported const HeaderAuthorization should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type Config should have comment or be unexported (golint)
    • Line 37: warning: exported type ResponseConfig should have comment or be unexported (golint)
    • Line 49: warning: exported function Configure should have comment or be unexported (golint)
    • Line 178: warning: exported type Authorizer should have comment or be unexported (golint)
    • Line 341: warning: exported function HandleSecureEndpointCustomErrorResponse should have comment or be unexported (golint)
    • Line 413: warning: exported function GetInternalServerErrorResponseBody should have comment or be unexported (golint)
    • Line 423: warning: exported function GetUnauthenticedErrorResponseBody should have comment or be unexported (golint)
    • Line 433: warning: exported function GetUnauthorizedErrorResponseBody should have comment or be unexported (golint)
    • go-utility/http-model/model.go
    • Line 4: warning: exported const HeaderContentType should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type ErrorResponse should have comment or be unexported (golint)
    • Line 17: warning: exported var ErrResponseUnsupportedMediaType should have comment or be unexported (golint)
    • Line 18: warning: exported var ErrResponseInternalServerError should have comment or be unexported (golint)
    • Line 19: warning: exported var ErrResponseUnauthorized should have comment or be unexported (golint)
    • Line 20: warning: exported var ErrResponseNotFound should have comment or be unexported (golint)
    • Line 22: warning: exported var ErrMessageInternalServerError should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrMessageUnauthorized should have comment or be unexported (golint)
    • Line 24: warning: exported var ErrMessageNotFound should have comment or be unexported (golint)
    • go-utility/auth/sign_in.go
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 22: warning: exported function Configure should have comment or be unexported (golint)
    • Line 26: warning: exported function GetBaseURL should have comment or be unexported (golint)
    • Line 131: warning: exported type SignInResponse should have comment or be unexported (golint)
    • Line 138: warning: exported type Tokens should have comment or be unexported (golint)
    • Line 144: warning: exported type Challenge should have comment or be unexported (golint)
    • go-utility/v2/cache/cache.go
    • Line 12: warning: exported type Cache should have comment or be unexported (golint)
    • Line 32: warning: exported function New should have comment or be unexported (golint)
    • Line 66: warning: exported method Cache.SetLogger should have comment or be unexported (golint)
    • Line 70: warning: exported method Cache.Clear should have comment or be unexported (golint)
    • Line 74: warning: exported method Cache.Sets should have comment or be unexported (golint)
    • Line 78: warning: exported method Cache.Gets should have comment or be unexported (golint)
    • Line 82: warning: exported method Cache.Misses should have comment or be unexported (golint)
    • Line 86: warning: exported method Cache.Hits should have comment or be unexported (golint)
    • Line 90: warning: exported method Cache.SetTTL should have comment or be unexported (golint)
    • go-utility/v2/cache/get.go
    • Line 7: warning: exported method Cache.Exist should have comment or be unexported (golint)
    • Line 12: warning: exported method Cache.Get should have comment or be unexported (golint)
    • go-utility/v2/http-model/model.go
    • Line 10: warning: exported const HeaderAuthorization should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported type ErrorResponse should have comment or be unexported (golint)
    • Line 34: warning: exported type HTTPError should have comment or be unexported (golint)
    • Line 43: warning: exported method HTTPError.Message should have comment or be unexported (golint)
    • Line 53: warning: exported var ErrResponseUnsupportedMediaType should have comment or be unexported (golint)
    • Line 54: warning: exported var ErrResponseInternalServerError should have comment or be unexported (golint)
    • Line 55: warning: exported var ErrResponseBadRequest should have comment or be unexported (golint)
    • Line 56: warning: exported var ErrResponseTooManyRequests should have comment or be unexported (golint)
    • Line 57: warning: exported var ErrResponseUnauthorized should have comment or be unexported (golint)
    • Line 58: warning: exported var ErrResponseNotFound should have comment or be unexported (golint)
    • Line 59: warning: exported var ErrResponseMethodNotAllowed should have comment or be unexported (golint)
    • Line 61: warning: exported var ErrMessageInternalServerError should have comment or be unexported (golint)
    • Line 62: warning: exported var ErrMessageUnauthorized should have comment or be unexported (golint)
    • Line 63: warning: exported var ErrMessageNotFound should have comment or be unexported (golint)
    • go-utility/v2/log/log.go
    • Line 15: warning: exported type Field should have comment or be unexported (golint)
    • Line 16: warning: exported type Fields should have comment or be unexported (golint)
    • Line 17: warning: exported type Level should have comment or be unexported (golint)
    • Line 19: warning: exported type Logger should have comment or be unexported (golint)
    • Line 73: warning: exported function SetDefaultService should have comment or be unexported (golint)
    • Line 77: warning: exported function SetDefaultField should have comment or be unexported (golint)
    • Line 120: warning: exported function Base should have comment or be unexported (golint)
    • Line 124: warning: exported function Nop should have comment or be unexported (golint)
    • Line 128: warning: exported function WithField should have comment or be unexported (golint)
    • Line 132: warning: exported function WithFields should have comment or be unexported (golint)
    • Line 136: warning: exported function WithError should have comment or be unexported (golint)
    • Line 145: warning: exported function WithUserID should have comment or be unexported (golint)
    • Line 156: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 160: warning: exported function Infof should have comment or be unexported (golint)
    • Line 164: warning: exported function Warnf should have comment or be unexported (golint)
    • Line 168: warning: exported function Warningf should have comment or be unexported (golint)
    • Line 172: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 176: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 180: warning: exported function Panicf should have comment or be unexported (golint)
    • Line 184: warning: exported function Debug should have comment or be unexported (golint)
    • Line 188: warning: exported function Info should have comment or be unexported (golint)
    • Line 192: warning: exported function Warn should have comment or be unexported (golint)
    • Line 196: warning: exported function Warning should have comment or be unexported (golint)
    • Line 200: warning: exported function Error should have comment or be unexported (golint)
    • Line 204: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 208: warning: exported function Panic should have comment or be unexported (golint)
    • Line 212: warning: exported function CheckWrite should have comment or be unexported (golint)
    • go-utility/http-server/server.go
    • Line 22: warning: exported function StartHealthServer should have comment or be unexported (golint)
    • Line 34: warning: exported function SetupDatadogInstrumentation should have comment or be unexported (golint)
    • Line 59: warning: exported function UnmarshalRequest should have comment or be unexported (golint)
    • Line 67: warning: exported function MarshalAndWriteJSONResponse should have comment or be unexported (golint)
    • Line 82: warning: exported function WriteJSONResponse should have comment or be unexported (golint)
    • Line 102: warning: exported function StatusNotFoundHandler should have comment or be unexported (golint)
    • go-utility/jwt/jwt.go
    • Line 10: warning: exported type Token should have comment or be unexported (golint)
    • Line 12: warning: exported method Token.GetClaims should have comment or be unexported (golint)
    • Line 20: warning: exported type CognitoClaims should have comment or be unexported (golint)
    • Line 25: warning: exported type EnlightClaims should have comment or be unexported (golint)
    • Line 29: warning: exported type Claims should have comment or be unexported (golint)
    • Line 35: warning: exported const TokenUseAccess should have comment or be unexported (golint)
    • Line 36: warning: exported const TokenUseID should have comment or be unexported (golint)
    • Line 38: warning: exported method Claims.Valid should have comment or be unexported (golint)
    • Line 59: warning: exported function Parse should have comment or be unexported (golint)
    • go-utility/v2/jwt/jwt.go
    • Line 10: warning: exported type Token should have comment or be unexported (golint)
    • Line 12: warning: exported method Token.GetClaims should have comment or be unexported (golint)
    • Line 21: warning: exported type CognitoClaims should have comment or be unexported (golint)
    • Line 26: warning: exported type EnlightClaims should have comment or be unexported (golint)
    • Line 33: warning: exported type Claims should have comment or be unexported (golint)
    • Line 39: warning: exported const TokenUseAccess should have comment or be unexported (golint)
    • Line 40: warning: exported const TokenUseID should have comment or be unexported (golint)
    • Line 42: warning: exported method Claims.Valid should have comment or be unexported (golint)
    • Line 63: warning: exported function Parse should have comment or be unexported (golint)
    • go-utility/v2/array/array.go
    • Line 18: warning: exported function MergeString should have comment or be unexported (golint)
    • Line 26: warning: exported function DistinctString should have comment or be unexported (golint)
    • Line 39: warning: exported function IntersectString should have comment or be unexported (golint)
    • Line 54: warning: exported function DifferenceString should have comment or be unexported (golint)
    • Line 66: warning: exported function ContainsString should have comment or be unexported (golint)
    • Line 76: warning: exported function ContainsEmpty should have comment or be unexported (golint)
    • go-utility/v2/trace/ddpgx/ddpgx.go
    • Line 19: warning: exported type Connection should have comment or be unexported (golint)
    • Line 28: warning: exported function Connect should have comment or be unexported (golint)
    • Line 41: warning: exported function ConnectPoolConfig should have comment or be unexported (golint)
    • go-utility/v2/http-server/server.go
    • Line 22: warning: exported function StartHealthServer should have comment or be unexported (golint)
    • Line 34: warning: exported function SetupDatadogInstrumentation should have comment or be unexported (golint)
    • Line 60: warning: exported function UnmarshalRequest should have comment or be unexported (golint)
    • Line 91: warning: exported function WriteJSONResponse should have comment or be unexported (golint)
    • Line 115: warning: exported function StatusNotFoundHandler should have comment or be unexported (golint)
    • Line 123: warning: exported function MethodNotAllowedHandler should have comment or be unexported (golint)
    • go-utility/log/log.go
    • Line 15: warning: exported type Field should have comment or be unexported (golint)
    • Line 16: warning: exported type Fields should have comment or be unexported (golint)
    • Line 17: warning: exported type Level should have comment or be unexported (golint)
    • Line 19: warning: exported type Logger should have comment or be unexported (golint)
    • Line 63: warning: exported function SetDefaultService should have comment or be unexported (golint)
    • Line 67: warning: exported function SetDefaultField should have comment or be unexported (golint)
    • Line 107: warning: exported function Base should have comment or be unexported (golint)
    • Line 111: warning: exported function WithField should have comment or be unexported (golint)
    • Line 115: warning: exported function WithFields should have comment or be unexported (golint)
    • Line 119: warning: exported function WithError should have comment or be unexported (golint)
    • Line 135: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 139: warning: exported function Infof should have comment or be unexported (golint)
    • Line 143: warning: exported function Warnf should have comment or be unexported (golint)
    • Line 147: warning: exported function Warningf should have comment or be unexported (golint)
    • Line 151: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 155: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 159: warning: exported function Panicf should have comment or be unexported (golint)
    • Line 163: warning: exported function Debug should have comment or be unexported (golint)
    • Line 167: warning: exported function Info should have comment or be unexported (golint)
    • Line 171: warning: exported function Warn should have comment or be unexported (golint)
    • Line 175: warning: exported function Warning should have comment or be unexported (golint)
    • Line 179: warning: exported function Error should have comment or be unexported (golint)
    • Line 183: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 187: warning: exported function Panic should have comment or be unexported (golint)
    • Line 191: warning: exported function CheckWrite should have comment or be unexported (golint)
    • go-utility/http-middleware/security.go
    • Line 20: warning: exported const HeaderAuthorization should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type Users should have comment or be unexported (golint)
    • Line 63: warning: exported type UserIDContextKey should have comment or be unexported (golint)
    • Line 107: warning: exported type Authorizer should have comment or be unexported (golint)
    • go-utility/v2/auth/sign_in.go
    • Line 19: warning: exported type Config should have comment or be unexported (golint)
    • Line 26: warning: exported function Configure should have comment or be unexported (golint)
    • Line 31: warning: exported function GetBaseURL should have comment or be unexported (golint)
    • Line 69: warning: exported function SignInRefreshToken should have comment or be unexported (golint)
    • Line 163: warning: exported type SignInResponse should have comment or be unexported (golint)
    • Line 170: warning: exported type Tokens should have comment or be unexported (golint)
    • Line 176: warning: exported type Challenge 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!