diff --git a/nodedb.go b/nodedb.go index 10c5546d1..f997596a8 100644 --- a/nodedb.go +++ b/nodedb.go @@ -204,7 +204,7 @@ func (ndb *nodeDB) GetFastNode(key []byte) (*fastnode.Node, error) { defer ndb.mtx.Unlock() if len(key) == 0 { - return nil, fmt.Errorf("nodeDB.GetFastNode() requires key, len(key) equals 0") + return nil, errors.New("nodeDB.GetFastNode() requires key, len(key) equals 0") } if cachedFastNode := ndb.fastNodeCache.Get(key); cachedFastNode != nil { @@ -1338,4 +1338,4 @@ func (ndb *nodeDB) String() (string, error) { return "-" + "\n" + buf.String() + "-", nil } -var ErrNodeMissingNodeKey = fmt.Errorf("node does not have a nodeKey") +var ErrNodeMissingNodeKey = errors.New("node does not have a nodeKey") diff --git a/nodedb_test.go b/nodedb_test.go index 170261110..f87103025 100644 --- a/nodedb_test.go +++ b/nodedb_test.go @@ -278,7 +278,7 @@ func TestTraverseNodes(t *testing.T) { return err } if actualNode.String() != node.String() { - return fmt.Errorf("found unexpected node") + return errors.New("found unexpected node") } count++ return nil