chore: apply golangci "forbidigo" to all packages (#39151)

This commit is contained in:
wxiaoguang
2026-08-28 00:34:44 +08:00
committed by GitHub
parent 66c672d0b7
commit b7cfa4e67e
17 changed files with 61 additions and 54 deletions
+10 -4
View File
@@ -1,8 +1,6 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// Package cmd provides subcommands to the gitea binary - such as "web" or
// "admin".
package cmd
import (
@@ -22,8 +20,8 @@ import (
"github.com/urfave/cli/v3"
)
// argsSet checks that all the required arguments are set. args is a list of
// arguments that must be set in the passed Context.
// argsSet checks that all the required arguments are set.
// args is a list of arguments that must be set in the command context.
func argsSet(c *cli.Command, args ...string) error {
for _, a := range args {
if !c.IsSet(a) {
@@ -141,3 +139,11 @@ func isValidDefaultSubCommand(cmd *cli.Command) (string, bool) {
}
return "", true
}
func cprintf(c *cli.Command, format string, args ...any) {
_, _ = fmt.Fprintf(c.Writer, format, args...)
}
func cprintln(c *cli.Command, args ...any) {
_, _ = fmt.Fprintln(c.Writer, args...)
}