cmd: use errrors.New instead of empty fmt.Errorf (#27329)

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
Delweng
2023-05-24 12:21:29 +02:00
committed by GitHub
parent 9231770811
commit e9c3183c52
20 changed files with 50 additions and 38 deletions
+3 -2
View File
@@ -17,6 +17,7 @@
package main
import (
"errors"
"fmt"
"net"
@@ -86,7 +87,7 @@ var (
func genkey(ctx *cli.Context) error {
if ctx.NArg() != 1 {
return fmt.Errorf("need key file as argument")
return errors.New("need key file as argument")
}
file := ctx.Args().Get(0)
@@ -126,7 +127,7 @@ func keyToRecord(ctx *cli.Context) error {
func makeRecord(ctx *cli.Context) (*enode.Node, error) {
if ctx.NArg() != 1 {
return nil, fmt.Errorf("need key file as argument")
return nil, errors.New("need key file as argument")
}
var (