Bump golangci-lint to 2.7.2, enable modernize stringsbuilder (#36180)

Fixes were done automatically by `make lint-go-fix`. These modernize
fixes are very readable.

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
silverwind
2025-12-17 21:50:53 +01:00
committed by GitHub
parent ebf9b4dc6b
commit 1e22bd712f
16 changed files with 67 additions and 63 deletions

View File

@@ -179,11 +179,11 @@ func AuthorizeOAuth(ctx *context.Context) {
errs := binding.Errors{}
errs = form.Validate(ctx.Req, errs)
if len(errs) > 0 {
errstring := ""
var errstring strings.Builder
for _, e := range errs {
errstring += e.Error() + "\n"
errstring.WriteString(e.Error() + "\n")
}
ctx.ServerError("AuthorizeOAuth: Validate: ", fmt.Errorf("errors occurred during validation: %s", errstring))
ctx.ServerError("AuthorizeOAuth: Validate: ", fmt.Errorf("errors occurred during validation: %s", errstring.String()))
return
}