mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Enable addtional linters (#34085)
enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -311,13 +311,13 @@ func preReceiveBranch(ctx *preReceiveContext, oldCommitID, newCommitID string, r
|
||||
if isForcePush {
|
||||
log.Warn("Forbidden: User %d is not allowed to force-push to protected branch: %s in %-v", ctx.opts.UserID, branchName, repo)
|
||||
ctx.JSON(http.StatusForbidden, private.Response{
|
||||
UserMsg: fmt.Sprintf("Not allowed to force-push to protected branch %s", branchName),
|
||||
UserMsg: "Not allowed to force-push to protected branch " + branchName,
|
||||
})
|
||||
return
|
||||
}
|
||||
log.Warn("Forbidden: User %d is not allowed to push to protected branch: %s in %-v", ctx.opts.UserID, branchName, repo)
|
||||
ctx.JSON(http.StatusForbidden, private.Response{
|
||||
UserMsg: fmt.Sprintf("Not allowed to push to protected branch %s", branchName),
|
||||
UserMsg: "Not allowed to push to protected branch " + branchName,
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -353,7 +353,7 @@ func preReceiveBranch(ctx *preReceiveContext, oldCommitID, newCommitID string, r
|
||||
if !allowedMerge {
|
||||
log.Warn("Forbidden: User %d is not allowed to push to protected branch: %s in %-v and is not allowed to merge pr #%d", ctx.opts.UserID, branchName, repo, pr.Index)
|
||||
ctx.JSON(http.StatusForbidden, private.Response{
|
||||
UserMsg: fmt.Sprintf("Not allowed to push to protected branch %s", branchName),
|
||||
UserMsg: "Not allowed to push to protected branch " + branchName,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@@ -6,7 +6,6 @@ package private
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
@@ -113,7 +112,7 @@ type errUnverifiedCommit struct {
|
||||
}
|
||||
|
||||
func (e *errUnverifiedCommit) Error() string {
|
||||
return fmt.Sprintf("Unverified commit: %s", e.sha)
|
||||
return "Unverified commit: " + e.sha
|
||||
}
|
||||
|
||||
func isErrUnverifiedCommit(err error) bool {
|
||||
|
@@ -180,7 +180,7 @@ func AddLogger(ctx *context.PrivateContext) {
|
||||
writerOption.Addr, _ = opts.Config["address"].(string)
|
||||
writerMode.WriterOption = writerOption
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid log writer mode: %s", writerType))
|
||||
panic("invalid log writer mode: " + writerType)
|
||||
}
|
||||
writer, err := log.NewEventWriter(opts.Writer, writerType, writerMode)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user