From 7f98e8e5f1a9d279d9672f9dc01f81d611b0a945 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 7 Feb 2017 16:51:58 -0800 Subject: [PATCH] channeldb: fix warnings found by `go vet` --- channeldb/db.go | 4 ++-- channeldb/db_test.go | 2 +- channeldb/meta_test.go | 2 +- channeldb/nodes.go | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/channeldb/db.go b/channeldb/db.go index d3dc26ff..4b07fb76 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -236,7 +236,7 @@ func (d *DB) FetchOpenChannels(nodeID *btcec.PublicKey) ([]*OpenChannel, error) nodeChanBucket) if err != nil { return fmt.Errorf("unable to read channel for "+ - "node_key=%x: ", pub, err) + "node_key=%x: %v", pub, err) } channels = nodeChannels @@ -324,7 +324,7 @@ func (d *DB) FetchAllChannels() ([]*OpenChannel, error) { nodeChanBucket) if err != nil { return fmt.Errorf("unable to read channel for "+ - "node_key=%x: ", k, err) + "node_key=%x: %v", k, err) } channels = append(channels, nodeChannels...) diff --git a/channeldb/db_test.go b/channeldb/db_test.go index 69c2d3b5..cff772cc 100644 --- a/channeldb/db_test.go +++ b/channeldb/db_test.go @@ -12,7 +12,7 @@ func TestOpenWithCreate(t *testing.T) { // this test. tempDirName, err := ioutil.TempDir("", "channeldb") if err != nil { - t.Fatalf("unable to create temp dir: %v") + t.Fatalf("unable to create temp dir: %v", err) } defer os.RemoveAll(tempDirName) diff --git a/channeldb/meta_test.go b/channeldb/meta_test.go index ac36c784..cea1b9ba 100644 --- a/channeldb/meta_test.go +++ b/channeldb/meta_test.go @@ -130,7 +130,7 @@ func applyMigration(t *testing.T, beforeMigration, afterMigration func(d *DB), // Than creating the version list pretending that new version was added. meta := &Meta{DbVersionNumber: 0} if err := cdb.PutMeta(meta); err != nil { - t.Fatal("unable to store meta data: %v", err) + t.Fatalf("unable to store meta data: %v", err) } versions := []version{ diff --git a/channeldb/nodes.go b/channeldb/nodes.go index f5ae2b8b..c92c004d 100644 --- a/channeldb/nodes.go +++ b/channeldb/nodes.go @@ -197,8 +197,6 @@ func (db *DB) FetchAllLinkNodes() ([]*LinkNode, error) { linkNodes = append(linkNodes, linkNode) return nil }) - - return nil }) if err != nil { return nil, err