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
+2 -1
View File
@@ -19,6 +19,7 @@ package v4test
import (
"bytes"
"crypto/rand"
"errors"
"fmt"
"net"
"time"
@@ -119,7 +120,7 @@ func (te *testenv) checkPingPong(pingHash []byte) error {
// and a PING. The two packets do not have to be in any particular order.
func (te *testenv) checkPong(reply v4wire.Packet, pingHash []byte) error {
if reply == nil {
return fmt.Errorf("expected PONG reply, got nil")
return errors.New("expected PONG reply, got nil")
}
if reply.Kind() != v4wire.PongPacket {
return fmt.Errorf("expected PONG reply, got %v %v", reply.Name(), reply)