summaryrefslogtreecommitdiffstats
path: root/routers/repo/view.go
diff options
context:
space:
mode:
authorkolaente <k@knt.li>2020-10-11 22:27:20 +0200
committerGitHub <noreply@github.com>2020-10-11 21:27:20 +0100
commit64133126cdb842a047b2cd104c2f177f6e83f79a (patch)
tree8bfd86c1f7a3c565c19552c588758674384796e3 /routers/repo/view.go
parente35f7e81ae7ed8388a8011baa43cb4faf42ebfe0 (diff)
downloadgitea-64133126cdb842a047b2cd104c2f177f6e83f79a.tar.gz
gitea-64133126cdb842a047b2cd104c2f177f6e83f79a.zip
Update golangci-lint to version 1.31.0 (#13102)
This PR updates golangci-lint to the latest version 1.31.0. The upgrade introduced a new check for which I've fixed or disabled most cases. Signed-off-by: kolaente <k@knt.li>
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r--routers/repo/view.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 3e2a57415d..2df5b30ce8 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -332,8 +332,8 @@ func renderDirectory(ctx *context.Context, treeLink string) {
ctx.Data["FileContent"] = string(markup.Render(readmeFile.name, buf, readmeTreelink, ctx.Repo.Repository.ComposeDocumentMetas()))
} else {
ctx.Data["IsRenderedHTML"] = true
- ctx.Data["FileContent"] = strings.Replace(
- gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, -1,
+ ctx.Data["FileContent"] = strings.ReplaceAll(
+ gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`,
)
}
}
@@ -471,8 +471,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
ctx.Data["FileContent"] = string(markup.Render(blob.Name(), buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeDocumentMetas()))
} else if readmeExist {
ctx.Data["IsRenderedHTML"] = true
- ctx.Data["FileContent"] = strings.Replace(
- gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, -1,
+ ctx.Data["FileContent"] = strings.ReplaceAll(
+ gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`,
)
} else {
buf = charset.ToUTF8WithFallback(buf)