1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 22:47:21 +00:00

chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621)

use errors.New to replace fmt.Errorf with no parameters will much better
This commit is contained in:
Cheng
2024-04-22 03:44:03 +08:00
committed by GitHub
parent f95622cddc
commit 9de443ced2
10 changed files with 21 additions and 15 deletions

View File

@ -4,6 +4,7 @@
package cmd
import (
"errors"
"fmt"
"os"
@ -249,7 +250,7 @@ func runAddFileLogger(c *cli.Context) error {
if c.IsSet("filename") {
vals["filename"] = c.String("filename")
} else {
return fmt.Errorf("filename must be set when creating a file logger")
return errors.New("filename must be set when creating a file logger")
}
if c.IsSet("rotate") {
vals["rotate"] = c.Bool("rotate")