Enable linters for golangci-lint (#1221)

* Enable linters for golangci-lint

* Remove unused nolint

* Fix lint
This commit is contained in:
sonata 2020-07-10 10:50:06 +09:00 committed by GitHub
parent 45db4bd567
commit b98fda6f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -73,6 +73,7 @@ linters:
- dogsled - dogsled
- dupl - dupl
- errcheck - errcheck
- exhaustive
- funlen - funlen
- gochecknoinits - gochecknoinits
- goconst - goconst
@ -91,6 +92,7 @@ linters:
- lll - lll
- misspell - misspell
- nakedret - nakedret
- noctx
- nolintlint - nolintlint
- rowserrcheck - rowserrcheck
- scopelint - scopelint
@ -106,7 +108,6 @@ linters:
# don't enable: # don't enable:
# - asciicheck # - asciicheck
# - exhaustive (TODO: enable after next release; current release at time of writing is v1.27)
# - gochecknoglobals # - gochecknoglobals
# - gocognit # - gocognit
# - godot # - godot
@ -114,7 +115,6 @@ linters:
# - goerr113 # - goerr113
# - maligned # - maligned
# - nestif # - nestif
# - noctx (TODO: enable after next release; current release at time of writing is v1.27)
# - prealloc # - prealloc
# - testpackage # - testpackage
# - wsl # - wsl

View File

@ -446,8 +446,8 @@ func (e *Executor) executeRun(_ *cobra.Command, args []string) {
// to be removed when deadline is finally decommissioned // to be removed when deadline is finally decommissioned
func (e *Executor) setTimeoutToDeadlineIfOnlyDeadlineIsSet() { func (e *Executor) setTimeoutToDeadlineIfOnlyDeadlineIsSet() {
//lint:ignore SA1019 We want to promoted the deprecated config value when needed // nolint:staticcheck
deadlineValue := e.cfg.Run.Deadline // nolint:staticcheck deadlineValue := e.cfg.Run.Deadline
if deadlineValue != 0 && e.cfg.Run.Timeout == defaultTimeout { if deadlineValue != 0 && e.cfg.Run.Timeout == defaultTimeout {
e.cfg.Run.Timeout = deadlineValue e.cfg.Run.Timeout = deadlineValue
} }