Skip to content

Commit 4b20b51

Browse files
authored
Update golangci-lint to v1.59.0 (#31221)
One new error regarding `fmt.Fscanf` error return in `gitdiff.go` but I'm not touching that further right now as handling the error would introduce a behaviour difference.
1 parent c685420 commit 4b20b51

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ XGO_VERSION := go-1.22.x
2828
AIR_PACKAGE ?= github.com/cosmtrek/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@db51e79a0e37c572d8b59ae0c58bf2bbbbe53285

Diff for: services/gitdiff/gitdiff.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ func readFileName(rd *strings.Reader) (string, bool) {
10611061
char, _ := rd.ReadByte()
10621062
_ = rd.UnreadByte()
10631063
if char == '"' {
1064-
fmt.Fscanf(rd, "%q ", &name)
1064+
_, _ = fmt.Fscanf(rd, "%q ", &name)
10651065
if len(name) == 0 {
10661066
log.Error("Reader has no file name: reader=%+v", rd)
10671067
return "", true
@@ -1073,12 +1073,12 @@ func readFileName(rd *strings.Reader) (string, bool) {
10731073
} else {
10741074
// This technique is potentially ambiguous it may not be possible to uniquely identify the filenames from the diff line alone
10751075
ambiguity = true
1076-
fmt.Fscanf(rd, "%s ", &name)
1076+
_, _ = fmt.Fscanf(rd, "%s ", &name)
10771077
char, _ := rd.ReadByte()
10781078
_ = rd.UnreadByte()
10791079
for !(char == 0 || char == '"' || char == 'b') {
10801080
var suffix string
1081-
fmt.Fscanf(rd, "%s ", &suffix)
1081+
_, _ = fmt.Fscanf(rd, "%s ", &suffix)
10821082
name += " " + suffix
10831083
char, _ = rd.ReadByte()
10841084
_ = rd.UnreadByte()

0 commit comments

Comments
 (0)