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

Signed-off-by: ChengenH <hce19970702@gmail.com>
This commit is contained in:
ChengenH
2024-04-21 21:49:31 +08:00
parent 8936631603
commit 4a31bd606d
9 changed files with 22 additions and 16 deletions

View File

@@ -581,7 +581,7 @@ var (
func edit(context *cli.Context, rd io.Reader) (_ io.ReadCloser, retErr error) {
editor := context.String("editor")
if editor == "" {
return nil, fmt.Errorf("editor is required")
return nil, errors.New("editor is required")
}
tmp, err := os.CreateTemp(os.Getenv("XDG_RUNTIME_DIR"), "edit-")