Preparing report...

Report for github.com/rekby/lets-proxy2

A+    Excellent!    Found 53 issues across 96 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!


gocyclo95%

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.


golint44%

Golint is a linter for Go source code.

    • lets-proxy2/internal/docker/docker.go
    • Line 22: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 24: warning: exported type Config should have comment or be unexported (golint)
    • Line 33: warning: exported type Docker should have comment or be unexported (golint)
    • Line 39: warning: exported function New should have comment or be unexported (golint)
    • Line 55: warning: exported method Docker.GetTarget should have comment or be unexported (golint)
    • lets-proxy2/internal/cert_manager/interfaces.go
    • Line 1: warning: package comment should be of the form "Package cert_manager ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 11: warning: exported type DomainChecker should have comment or be unexported (golint)
    • Line 18: warning: exported type AcmeClient should have comment or be unexported (golint)
    • lets-proxy2/internal/config/metrics_config.go
    • Line 13: warning: exported type Config should have comment or be unexported (golint)
    • Line 20: warning: exported method Config.GetListenConfig should have comment or be unexported (golint)
    • Line 24: warning: exported method Config.GetSecretHandlerConfig should have comment or be unexported (golint)
    • lets-proxy2/internal/acme_client_manager/client_manager.go
    • Line 1: warning: package comment should be of the form "Package acme_client_manager ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 33: warning: comment on exported type AcmeManager should be of the form "AcmeManager ..." (with optional leading article) (golint)
    • Line 52: warning: exported function New should have comment or be unexported (golint)
    • Line 69: warning: exported method AcmeManager.Close should have comment or be unexported (golint)
    • Line 92: warning: exported method AcmeManager.GetClient should have comment or be unexported (golint)
    • lets-proxy2/internal/domain_checker/ip_list_sources.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 26: warning: comment on exported function NewSelfIPChecker should be of the form "NewSelfIPChecker ..." (golint)
    • Line 90: warning: exported function AWSMetadataAvailable should have comment or be unexported (golint)
    • Line 99: warning: exported function AWSPublicIPs should have comment or be unexported (golint)
    • Line 146: warning: exported function GetIPByExternalRequest should have comment or be unexported (golint)
    • Line 217: warning: exported function SelfBindedPublicIPs should have comment or be unexported (golint)
    • lets-proxy2/internal/metrics/metrics.go
    • Line 13: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 18: warning: exported type ProcessStartFunc should have comment or be unexported (golint)
    • Line 19: warning: exported type ProcessFinishFunc should have comment or be unexported (golint)
    • Line 38: warning: exported function New should have comment or be unexported (golint)
    • Line 48: warning: exported function ToefCounters should have comment or be unexported (golint)
    • lets-proxy2/internal/cache/memory.go
    • Line 11: warning: exported type MemoryCache should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMemoryCache should have comment or be unexported (golint)
    • Line 25: warning: exported method MemoryCache.Get should have comment or be unexported (golint)
    • Line 39: warning: exported method MemoryCache.Put should have comment or be unexported (golint)
    • Line 51: warning: exported method MemoryCache.Delete should have comment or be unexported (golint)
    • lets-proxy2/internal/tlslistener/tlslistenershandler.go
    • Line 26: warning: exported type ListenersHandler should have comment or be unexported (golint)
    • Line 55: warning: comment on exported method ListenersHandler.Accept should be of the form "Accept ..." (golint)
    • Line 60: warning: exported method ListenersHandler.Close should have comment or be unexported (golint)
    • Line 65: warning: exported method ListenersHandler.Addr should have comment or be unexported (golint)
    • Line 69: warning: exported method ListenersHandler.Start should have comment or be unexported (golint)
    • Line 194: warning: exported method ListenersHandler.GetConnectionContext should have comment or be unexported (golint)
    • lets-proxy2/internal/cert_manager/manager.go
    • Line 1: warning: package comment should be of the form "Package cert_manager ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 60: warning: exported type GetContext should have comment or be unexported (golint)
    • Line 64: warning: exported type KeyType should have comment or be unexported (golint)
    • Line 66: warning: exported const KeyRSA should have comment or be unexported (golint)
    • Line 67: warning: exported const KeyECDSA should have comment or be unexported (golint)
    • Line 69: warning: exported method KeyType.Generate should have comment or be unexported (golint)
    • Line 84: warning: comment on exported type Manager should be of the form "Manager ..." (with optional leading article) (golint)
    • Line 121: warning: exported function New should have comment or be unexported (golint)
    • Line 676: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 701: warning: exported method Manager.HandleHTTPValidation should have comment or be unexported (golint)
    • lets-proxy2/internal/tlslistener/context_conn.go
    • Line 16: warning: exported type ContextConnextion should have comment or be unexported (golint)
    • Line 23: warning: exported method ContextConnextion.GetContext should have comment or be unexported (golint)
    • Line 27: warning: exported method ContextConnextion.Close should have comment or be unexported (golint)
    • lets-proxy2/internal/th/helper.go
    • Line 18: warning: exported function TestContext should have comment or be unexported (golint)
    • Line 31: warning: exported function NoLog should have comment or be unexported (golint)
    • Line 35: warning: exported function Logger should have comment or be unexported (golint)
    • Line 39: warning: exported function Close should have comment or be unexported (golint)
    • Line 43: warning: exported function GetHttpClient should have comment or be unexported (golint)
    • Line 53: warning: exported function ErrorSubstringCmp should have comment or be unexported (golint)
    • lets-proxy2/internal/cert_manager/cert_desctiption.go
    • Line 1: warning: package comment should be of the form "Package cert_manager ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 12: warning: exported type CertDescription should have comment or be unexported (golint)
    • Line 18: warning: exported method CertDescription.CertStoreName should have comment or be unexported (golint)
    • Line 22: warning: exported method CertDescription.DomainNames should have comment or be unexported (golint)
    • Line 31: warning: exported method CertDescription.KeyStoreName should have comment or be unexported (golint)
    • Line 35: warning: exported method CertDescription.LockName should have comment or be unexported (golint)
    • Line 39: warning: exported method CertDescription.MetaStoreName should have comment or be unexported (golint)
    • Line 47: warning: exported method CertDescription.ZapField should have comment or be unexported (golint)
    • Line 51: warning: exported function CertDescriptionFromDomain should have comment or be unexported (golint)
    • lets-proxy2/internal/cache/interface.go
    • Line 8: warning: exported var ErrCacheMiss should have comment or be unexported (golint)
    • Line 10: warning: exported type Bytes should have comment or be unexported (golint)
    • Line 25: warning: exported type Value should have comment or be unexported (golint)
    • lets-proxy2/internal/log/log.go
    • Line 29: warning: exported function Cert should have comment or be unexported (golint)
    • Line 36: warning: exported function CertX509 should have comment or be unexported (golint)
    • Line 40: warning: exported function DebugInfo should have comment or be unexported (golint)
    • Line 44: warning: exported function DebugInfoCtx should have comment or be unexported (golint)
    • Line 48: warning: exported function DebugWarning should have comment or be unexported (golint)
    • Line 61: warning: exported function DebugError should have comment or be unexported (golint)
    • Line 65: warning: exported function DebugDPanic should have comment or be unexported (golint)
    • Line 69: warning: exported function DebugDPanicCtx should have comment or be unexported (golint)
    • Line 83: warning: exported function DebugPanic should have comment or be unexported (golint)
    • Line 97: warning: exported function DebugCtx should have comment or be unexported (golint)
    • Line 102: warning: exported function DebugFatal should have comment or be unexported (golint)
    • Line 106: warning: exported function DebugFatalCtx should have comment or be unexported (golint)
    • Line 120: warning: exported function InfoCtx should have comment or be unexported (golint)
    • Line 125: warning: exported function InfoError should have comment or be unexported (golint)
    • Line 129: warning: exported function InfoErrorCtx should have comment or be unexported (golint)
    • Line 133: warning: exported function InfoFatal should have comment or be unexported (golint)
    • Line 137: warning: exported function InfoFatalCtx should have comment or be unexported (golint)
    • Line 150: warning: exported function InfoPanic should have comment or be unexported (golint)
    • Line 154: warning: exported function InfoDPanicCtx should have comment or be unexported (golint)
    • Line 158: warning: exported function InfoPanicCtx should have comment or be unexported (golint)
    • Line 162: warning: exported function DebugErrorCtx should have comment or be unexported (golint)
    • Line 211: warning: exported function LevelParam should have comment or be unexported (golint)
    • Line 215: warning: exported function LevelParamCtx should have comment or be unexported (golint)
    • lets-proxy2/internal/cache/value_lru.go
    • Line 25: warning: exported type MemoryValueLRU should have comment or be unexported (golint)
    • Line 36: warning: exported function NewMemoryValueLRU should have comment or be unexported (golint)
    • Line 45: warning: exported method MemoryValueLRU.Get should have comment or be unexported (golint)
    • Line 63: warning: exported method MemoryValueLRU.Put should have comment or be unexported (golint)
    • Line 79: warning: exported method MemoryValueLRU.Delete should have comment or be unexported (golint)
    • lets-proxy2/internal/domain_checker/chains.go
    • Line 1: warning: package comment should be of the form "Package domain_checker ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported type Any should have comment or be unexported (golint)
    • Line 12: warning: exported method Any.IsDomainAllowed should have comment or be unexported (golint)
    • Line 27: warning: exported function NewAny should have comment or be unexported (golint)
    • Line 31: warning: exported type All should have comment or be unexported (golint)
    • Line 33: warning: exported method All.IsDomainAllowed should have comment or be unexported (golint)
    • Line 48: warning: exported function NewAll should have comment or be unexported (golint)
    • Line 52: warning: exported function NewNot should have comment or be unexported (golint)
    • lets-proxy2/internal/domain_checker/ip_list.go
    • Line 1: warning: package comment should be of the form "Package domain_checker ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 57: warning: exported function SetDefaultResolver should have comment or be unexported (golint)
    • Line 61: warning: exported type IPList should have comment or be unexported (golint)
    • Line 72: warning: exported type Resolver should have comment or be unexported (golint)
    • Line 76: warning: exported type AllowedIPAddresses should have comment or be unexported (golint)
    • Line 78: warning: comment on exported function NewIPList should be of the form "NewIPList ..." (golint)
    • Line 91: warning: exported method IPList.IsDomainAllowed should have comment or be unexported (golint)
    • Line 126: warning: comment on exported method IPList.StartAutoRenew should be of the form "StartAutoRenew ..." (golint)
    • Line 176: warning: exported type InterfacesAddrFunc should have comment or be unexported (golint)
    • Line 178: warning: exported function ParseIPList should have comment or be unexported (golint)
    • lets-proxy2/internal/proxy/config.go
    • Line 22: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • Line 35: warning: exported method Config.Apply should have comment or be unexported (golint)
    • lets-proxy2/internal/domain_checker/config.go
    • Line 1: warning: package comment should be of the form "Package domain_checker ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 24: warning: exported type Config should have comment or be unexported (golint)
    • Line 34: warning: exported method Config.CreateDomainChecker should have comment or be unexported (golint)
    • lets-proxy2/internal/domain_checker/simple.go
    • Line 1: warning: package comment should be of the form "Package domain_checker ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 14: warning: exported type True should have comment or be unexported (golint)
    • Line 16: warning: exported method True.IsDomainAllowed should have comment or be unexported (golint)
    • Line 21: warning: exported type False should have comment or be unexported (golint)
    • Line 23: warning: exported method False.IsDomainAllowed should have comment or be unexported (golint)
    • Line 28: warning: exported type Not should have comment or be unexported (golint)
    • Line 32: warning: exported method Not.IsDomainAllowed should have comment or be unexported (golint)
    • Line 46: warning: exported type Regexp should have comment or be unexported (golint)
    • Line 48: warning: exported method Regexp.IsDomainAllowed should have comment or be unexported (golint)
    • Line 59: warning: exported function NewRegexp should have comment or be unexported (golint)
    • lets-proxy2/internal/proxy/http-proxy.go
    • Line 22: warning: exported type Director should have comment or be unexported (golint)
    • Line 26: warning: exported type HTTPProxy should have comment or be unexported (golint)
    • Line 40: warning: exported function NewHTTPProxy should have comment or be unexported (golint)
    • Line 56: warning: exported method HTTPProxy.Close should have comment or be unexported (golint)
    • lets-proxy2/internal/proxy/transport_logger.go
    • Line 12: warning: exported type TransportLogger should have comment or be unexported (golint)
    • Line 16: warning: exported method TransportLogger.RoundTrip should have comment or be unexported (golint)
    • Line 42: warning: exported function NewTransportLogger should have comment or be unexported (golint)
    • lets-proxy2/internal/domain/domain.go
    • Line 14: warning: exported type DomainName should have comment or be unexported (golint)
    • Line 20: warning: exported method DomainName.ASCII should have comment or be unexported (golint)
    • Line 24: warning: exported method DomainName.Unicode should have comment or be unexported (golint)
    • Line 32: warning: exported method DomainName.FullString should have comment or be unexported (golint)
    • Line 38: warning: exported function NormalizeDomain should have comment or be unexported (golint)
    • Line 51: warning: exported function LogDomain should have comment or be unexported (golint)
    • Line 64: warning: exported function LogDomains should have comment or be unexported (golint)
    • lets-proxy2/internal/cache/disk.go
    • Line 17: warning: exported type DiskCache should have comment or be unexported (golint)
    • Line 27: warning: exported method DiskCache.Get should have comment or be unexported (golint)
    • Line 49: warning: exported method DiskCache.Put should have comment or be unexported (golint)
    • Line 60: warning: exported method DiskCache.Delete should have comment or be unexported (golint)
    • lets-proxy2/internal/domain_checker/docker.go
    • Line 1: warning: package comment should be of the form "Package domain_checker ..." (golint)
    • Line 2: warning: don't use an underscore in package name (golint)
    • Line 13: warning: exported type DockerChecker should have comment or be unexported (golint)
    • Line 17: warning: exported method DockerChecker.IsDomainAllowed should have comment or be unexported (golint)
    • Line 33: warning: exported function NewDockerChecker should have comment or be unexported (golint)
    • lets-proxy2/internal/dns/resolver.go
    • Line 30: warning: comment on exported type Resolver should be of the form "Resolver ..." (with optional leading article) (golint)
    • Line 51: warning: exported method Resolver.LookupIPAddr should have comment or be unexported (golint)
    • lets-proxy2/internal/proxy/directors.go
    • Line 25: warning: exported const ConnectionID should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported const ProtocolHTTP should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported type DirectorChain should have comment or be unexported (golint)
    • Line 39: warning: exported method DirectorChain.Director should have comment or be unexported (golint)
    • Line 49: warning: comment on exported function NewDirectorChain should be of the form "NewDirectorChain ..." (golint)
    • Line 70: warning: exported type DirectorSameIP should have comment or be unexported (golint)
    • Line 74: warning: exported function NewDirectorSameIP should have comment or be unexported (golint)
    • Line 78: warning: exported method DirectorSameIP.Director should have comment or be unexported (golint)
    • Line 89: warning: exported type DirectorDestMap should have comment or be unexported (golint)
    • Line 91: warning: exported method DirectorDestMap.Director should have comment or be unexported (golint)
    • Line 114: warning: exported function NewDirectorDestMap should have comment or be unexported (golint)
    • Line 122: warning: exported type DirectorDocker should have comment or be unexported (golint)
    • Line 126: warning: exported method DirectorDocker.Director should have comment or be unexported (golint)
    • Line 152: warning: exported function NewDirectorDocker should have comment or be unexported (golint)
    • Line 156: warning: exported type DirectorHost should have comment or be unexported (golint)
    • Line 158: warning: exported method DirectorHost.Director should have comment or be unexported (golint)
    • Line 166: warning: exported function NewDirectorHost should have comment or be unexported (golint)
    • Line 170: warning: exported type DirectorSetHeaders should have comment or be unexported (golint)
    • Line 172: warning: exported function NewDirectorSetHeaders should have comment or be unexported (golint)
    • Line 180: warning: exported method DirectorSetHeaders.Director should have comment or be unexported (golint)
    • Line 220: warning: exported type DirectorSetScheme should have comment or be unexported (golint)
    • Line 222: warning: exported method DirectorSetScheme.Director should have comment or be unexported (golint)
    • Line 230: warning: exported function NewSetSchemeDirector should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!