mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-22 17:48:23 +08:00
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.
This commit is contained in:
@ -1061,7 +1061,7 @@ func readFileName(rd *strings.Reader) (string, bool) {
|
||||
char, _ := rd.ReadByte()
|
||||
_ = rd.UnreadByte()
|
||||
if char == '"' {
|
||||
fmt.Fscanf(rd, "%q ", &name)
|
||||
_, _ = fmt.Fscanf(rd, "%q ", &name)
|
||||
if len(name) == 0 {
|
||||
log.Error("Reader has no file name: reader=%+v", rd)
|
||||
return "", true
|
||||
@ -1073,12 +1073,12 @@ func readFileName(rd *strings.Reader) (string, bool) {
|
||||
} else {
|
||||
// This technique is potentially ambiguous it may not be possible to uniquely identify the filenames from the diff line alone
|
||||
ambiguity = true
|
||||
fmt.Fscanf(rd, "%s ", &name)
|
||||
_, _ = fmt.Fscanf(rd, "%s ", &name)
|
||||
char, _ := rd.ReadByte()
|
||||
_ = rd.UnreadByte()
|
||||
for !(char == 0 || char == '"' || char == 'b') {
|
||||
var suffix string
|
||||
fmt.Fscanf(rd, "%s ", &suffix)
|
||||
_, _ = fmt.Fscanf(rd, "%s ", &suffix)
|
||||
name += " " + suffix
|
||||
char, _ = rd.ReadByte()
|
||||
_ = rd.UnreadByte()
|
||||
|
Reference in New Issue
Block a user