From bbf2da4c907f8f5234e65d141e4759dc7130fdd7 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sat, 26 Jul 2014 19:41:05 -0600 Subject: [PATCH] Fix go vet. --- cmd/bolt/bench.go | 6 +++--- cmd/bolt/export.go | 2 +- node_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/bolt/bench.go b/cmd/bolt/bench.go index b275542..91af960 100644 --- a/cmd/bolt/bench.go +++ b/cmd/bolt/bench.go @@ -283,7 +283,7 @@ func benchStartProfiling(options *BenchOptions) { if options.CPUProfile != "" { cpuprofile, err = os.Create(options.CPUProfile) if err != nil { - fatal("bench: could not create cpu profile %q: %v", options.CPUProfile, err) + fatalf("bench: could not create cpu profile %q: %v", options.CPUProfile, err) } pprof.StartCPUProfile(cpuprofile) } @@ -292,7 +292,7 @@ func benchStartProfiling(options *BenchOptions) { if options.MemProfile != "" { memprofile, err = os.Create(options.MemProfile) if err != nil { - fatal("bench: could not create memory profile %q: %v", options.MemProfile, err) + fatalf("bench: could not create memory profile %q: %v", options.MemProfile, err) } runtime.MemProfileRate = 4096 } @@ -301,7 +301,7 @@ func benchStartProfiling(options *BenchOptions) { if options.BlockProfile != "" { blockprofile, err = os.Create(options.BlockProfile) if err != nil { - fatal("bench: could not create block profile %q: %v", options.BlockProfile, err) + fatalf("bench: could not create block profile %q: %v", options.BlockProfile, err) } runtime.SetBlockProfileRate(1) } diff --git a/cmd/bolt/export.go b/cmd/bolt/export.go index 2689f32..9a0b112 100644 --- a/cmd/bolt/export.go +++ b/cmd/bolt/export.go @@ -42,7 +42,7 @@ func Export(path string) { // Encode all buckets into JSON. output, err := json.Marshal(root) if err != nil { - return fmt.Errorf("encode: ", err) + return fmt.Errorf("encode: %s", err) } print(string(output)) return nil diff --git a/node_test.go b/node_test.go index f4bf4af..fa5d10f 100644 --- a/node_test.go +++ b/node_test.go @@ -54,7 +54,7 @@ func TestNode_read_LeafPage(t *testing.T) { // Check that there are two inodes with correct data. if !n.isLeaf { - t.Fatalf("expected leaf", n.isLeaf) + t.Fatal("expected leaf") } if len(n.inodes) != 2 { t.Fatalf("exp=2; got=%d", len(n.inodes))