dev: fix govet.nilness lint issues (#4373)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
7cf6cc9d9f
commit
cc3e67b3bd
@ -52,7 +52,6 @@ linters-settings:
|
|||||||
- strings.SplitN
|
- strings.SplitN
|
||||||
|
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: true
|
|
||||||
settings:
|
settings:
|
||||||
printf:
|
printf:
|
||||||
funcs:
|
funcs:
|
||||||
@ -60,6 +59,9 @@ linters-settings:
|
|||||||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
|
||||||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
|
||||||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
|
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
|
||||||
|
enable:
|
||||||
|
- nilness
|
||||||
|
- shadow
|
||||||
errorlint:
|
errorlint:
|
||||||
asserts: false
|
asserts: false
|
||||||
lll:
|
lll:
|
||||||
|
@ -236,25 +236,22 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
|
|||||||
wrapcheckCfg = &m.cfg.LintersSettings.Wrapcheck
|
wrapcheckCfg = &m.cfg.LintersSettings.Wrapcheck
|
||||||
wslCfg = &m.cfg.LintersSettings.WSL
|
wslCfg = &m.cfg.LintersSettings.WSL
|
||||||
|
|
||||||
if govetCfg != nil {
|
|
||||||
govetCfg.Go = m.cfg.Run.Go
|
govetCfg.Go = m.cfg.Run.Go
|
||||||
}
|
|
||||||
|
|
||||||
if gocriticCfg != nil {
|
|
||||||
gocriticCfg.Go = trimGoVersion(m.cfg.Run.Go)
|
gocriticCfg.Go = trimGoVersion(m.cfg.Run.Go)
|
||||||
}
|
|
||||||
|
|
||||||
if gofumptCfg != nil && gofumptCfg.LangVersion == "" {
|
if gofumptCfg.LangVersion == "" {
|
||||||
gofumptCfg.LangVersion = m.cfg.Run.Go
|
gofumptCfg.LangVersion = m.cfg.Run.Go
|
||||||
}
|
}
|
||||||
|
|
||||||
if staticcheckCfg != nil && staticcheckCfg.GoVersion == "" {
|
// staticcheck related linters.
|
||||||
|
if staticcheckCfg.GoVersion == "" {
|
||||||
staticcheckCfg.GoVersion = trimGoVersion(m.cfg.Run.Go)
|
staticcheckCfg.GoVersion = trimGoVersion(m.cfg.Run.Go)
|
||||||
}
|
}
|
||||||
if gosimpleCfg != nil && gosimpleCfg.GoVersion == "" {
|
if gosimpleCfg.GoVersion == "" {
|
||||||
gosimpleCfg.GoVersion = trimGoVersion(m.cfg.Run.Go)
|
gosimpleCfg.GoVersion = trimGoVersion(m.cfg.Run.Go)
|
||||||
}
|
}
|
||||||
if stylecheckCfg != nil && stylecheckCfg.GoVersion != "" {
|
if stylecheckCfg.GoVersion != "" {
|
||||||
stylecheckCfg.GoVersion = trimGoVersion(m.cfg.Run.Go)
|
stylecheckCfg.GoVersion = trimGoVersion(m.cfg.Run.Go)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user