Merge pull request #17402 from Luap99/update-lint

update golangci-lint to version 1.51.1
This commit is contained in:
OpenShift Merge Robot
2023-02-07 11:00:16 -05:00
committed by GitHub
4 changed files with 15 additions and 4 deletions

View File

@ -47,6 +47,7 @@ linters:
- lll - lll
- gosec - gosec
- maligned - maligned
- musttag # way to many warnings to fix for now, also some false positives
- gomoddirectives - gomoddirectives
- containedctx - containedctx
- contextcheck - contextcheck
@ -73,3 +74,13 @@ linters-settings:
nolintlint: nolintlint:
allow-leading-space: false allow-leading-space: false
require-specific: true require-specific: true
issues:
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0

View File

@ -929,7 +929,7 @@ install.tools: .install.golangci-lint ## Install needed tools
.PHONY: .install.golangci-lint .PHONY: .install.golangci-lint
.install.golangci-lint: .install.golangci-lint:
VERSION=1.50.1 ./hack/install_golangci.sh VERSION=1.51.1 ./hack/install_golangci.sh
.PHONY: .install.swagger .PHONY: .install.swagger
.install.swagger: .install.swagger:

View File

@ -91,7 +91,7 @@ func (e EventLogFile) writeString(s string) error {
func (e EventLogFile) getTail(options ReadOptions) (*tail.Tail, error) { func (e EventLogFile) getTail(options ReadOptions) (*tail.Tail, error) {
reopen := true reopen := true
seek := tail.SeekInfo{Offset: 0, Whence: os.SEEK_END} seek := tail.SeekInfo{Offset: 0, Whence: io.SeekEnd}
if options.FromStart || !options.Stream { if options.FromStart || !options.Stream {
seek.Whence = 0 seek.Whence = 0
reopen = false reopen = false

View File

@ -1702,10 +1702,10 @@ func testHTTPServer(port string, shouldErr bool, expectedResponse string) {
time.Sleep(interval) time.Sleep(interval)
interval *= 2 interval *= 2
} }
Expect(err).To(BeNil()) Expect(err).ToNot(HaveOccurred())
body, err := io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
Expect(err).To(BeNil()) Expect(err).ToNot(HaveOccurred())
Expect(string(body)).Should(Equal(expectedResponse)) Expect(string(body)).Should(Equal(expectedResponse))
} }