From acaa692793bdbf36cac411a114116d457bb2768f Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 13 May 2021 08:21:34 -0700 Subject: [PATCH] fix staticcheck --- batch.go | 2 -- daghelpers_test.go | 4 ++-- format_test.go | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/batch.go b/batch.go index 2849103..6754a8c 100644 --- a/batch.go +++ b/batch.go @@ -106,8 +106,6 @@ func (t *Batch) asyncCommit() { t.activeCommits++ t.nodes = make([]Node, 0, numBlocks) t.size = 0 - - return } // Add adds a node to the batch and commits the batch if necessary. diff --git a/daghelpers_test.go b/daghelpers_test.go index 1dee848..a562f1d 100644 --- a/daghelpers_test.go +++ b/daghelpers_test.go @@ -28,7 +28,7 @@ func InitNode(d []byte) *TestNode { } func (n *TestNode) Resolve([]string) (interface{}, []string, error) { - return nil, nil, EmptyNodeError + return nil, nil, ErrEmptyNode } func (n *TestNode) Tree(string, int) []string { @@ -36,7 +36,7 @@ func (n *TestNode) Tree(string, int) []string { } func (n *TestNode) ResolveLink([]string) (*Link, []string, error) { - return nil, nil, EmptyNodeError + return nil, nil, ErrEmptyNode } func (n *TestNode) Copy() Node { diff --git a/format_test.go b/format_test.go index ed0ccf0..a6f7df9 100644 --- a/format_test.go +++ b/format_test.go @@ -10,10 +10,10 @@ import ( type EmptyNode struct{} -var EmptyNodeError error = errors.New("dummy node") +var ErrEmptyNode error = errors.New("dummy node") func (n *EmptyNode) Resolve([]string) (interface{}, []string, error) { - return nil, nil, EmptyNodeError + return nil, nil, ErrEmptyNode } func (n *EmptyNode) Tree(string, int) []string { @@ -21,7 +21,7 @@ func (n *EmptyNode) Tree(string, int) []string { } func (n *EmptyNode) ResolveLink([]string) (*Link, []string, error) { - return nil, nil, EmptyNodeError + return nil, nil, ErrEmptyNode } func (n *EmptyNode) Copy() Node {