aboutsummaryrefslogtreecommitdiffstats
path: root/services/gitdiff
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-06-03 09:04:35 +0200
committerGitHub <noreply@github.com>2024-06-03 07:04:35 +0000
commit4b20b51f8260cb012581493d1143033dd3936aa6 (patch)
tree5ec4c9aa55c9c7756eaf06a59fc5513813bcc041 /services/gitdiff
parentc6854202be9eb8358f046871d4eb0e4fd74639ff (diff)
downloadgitea-4b20b51f8260cb012581493d1143033dd3936aa6.tar.gz
gitea-4b20b51f8260cb012581493d1143033dd3936aa6.zip
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.
Diffstat (limited to 'services/gitdiff')
-rw-r--r--services/gitdiff/gitdiff.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go
index 063c995d52..0ddd5a48e2 100644
--- a/services/gitdiff/gitdiff.go
+++ b/services/gitdiff/gitdiff.go
@@ -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()