summaryrefslogtreecommitdiffstats
path: root/modules/upload/upload.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 /modules/upload/upload.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 'modules/upload/upload.go')
-rw-r--r--modules/upload/upload.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/upload/upload.go b/modules/upload/upload.go
index 97f0df0542..e430a5d8b3 100644
--- a/modules/upload/upload.go
+++ b/modules/upload/upload.go
@@ -76,7 +76,7 @@ func AddUploadContext(ctx *context.Context, uploadType string) {
ctx.Data["UploadUrl"] = ctx.Repo.RepoLink + "/releases/attachments"
ctx.Data["UploadRemoveUrl"] = ctx.Repo.RepoLink + "/releases/attachments/remove"
ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/releases/attachments"
- ctx.Data["UploadAccepts"] = strings.Replace(setting.Repository.Release.AllowedTypes, "|", ",", -1)
+ ctx.Data["UploadAccepts"] = strings.ReplaceAll(setting.Repository.Release.AllowedTypes, "|", ",")
ctx.Data["UploadMaxFiles"] = setting.Attachment.MaxFiles
ctx.Data["UploadMaxSize"] = setting.Attachment.MaxSize
} else if uploadType == "comment" {
@@ -87,14 +87,14 @@ func AddUploadContext(ctx *context.Context, uploadType string) {
} else {
ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/issues/attachments"
}
- ctx.Data["UploadAccepts"] = strings.Replace(setting.Attachment.AllowedTypes, "|", ",", -1)
+ ctx.Data["UploadAccepts"] = strings.ReplaceAll(setting.Attachment.AllowedTypes, "|", ",")
ctx.Data["UploadMaxFiles"] = setting.Attachment.MaxFiles
ctx.Data["UploadMaxSize"] = setting.Attachment.MaxSize
} else if uploadType == "repo" {
ctx.Data["UploadUrl"] = ctx.Repo.RepoLink + "/upload-file"
ctx.Data["UploadRemoveUrl"] = ctx.Repo.RepoLink + "/upload-remove"
ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/upload-file"
- ctx.Data["UploadAccepts"] = strings.Replace(setting.Repository.Upload.AllowedTypes, "|", ",", -1)
+ ctx.Data["UploadAccepts"] = strings.ReplaceAll(setting.Repository.Upload.AllowedTypes, "|", ",")
ctx.Data["UploadMaxFiles"] = setting.Repository.Upload.MaxFiles
ctx.Data["UploadMaxSize"] = setting.Repository.Upload.FileMaxSize
}