From d16ddf8b0664afe83e681fe58baa6da274c53c4b Mon Sep 17 00:00:00 2001 From: Anthony Olurin Date: Wed, 20 Jul 2016 08:57:29 -0400 Subject: [PATCH] go_vet, mispell and golint --- buntdb.go | 10 ++++++---- buntdb_test.go | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/buntdb.go b/buntdb.go index 4d25b5c..1b318e4 100644 --- a/buntdb.go +++ b/buntdb.go @@ -388,6 +388,8 @@ func (db *DB) backgroundManager() { } } } + +// Shrink function description [here] func (db *DB) Shrink() error { db.mu.Lock() if db.closed { @@ -470,7 +472,7 @@ func (db *DB) Shrink() error { if _, err := aof.Seek(endpos, 0); err != nil { return err } - // Just copy all of the new commands that have occured since we + // Just copy all of the new commands that have occurred since we // started the shrink process. if _, err := io.Copy(f, aof); err != nil { return err @@ -920,13 +922,13 @@ type SetOptions struct { } // Set inserts or replaces an item in the database based on the key. -// The opt params may be used for addtional functionality such as forcing +// The opt params may be used for additional functionality such as forcing // the item to be evicted at a specified time. When the return value -// for err is nil the operation succeded. When the return value of +// for err is nil the operation succeeded. When the return value of // replaced is true, then the operaton replaced an existing item whose // value will be returned through the previousValue variable. // The results of this operation will not be available to other -// transactions until the current transaction has successfully commited. +// transactions until the current transaction has successfully committed. func (tx *Tx) Set(key, value string, opts *SetOptions) (previousValue string, replaced bool, err error) { if tx.db == nil { diff --git a/buntdb_test.go b/buntdb_test.go index 11ae53e..7144d7d 100644 --- a/buntdb_test.go +++ b/buntdb_test.go @@ -87,7 +87,7 @@ func TestVariousTx(t *testing.T) { t.Fatal("a rollbacked transaction got through") } if val != "planet" { - t.Fatal("expecting '%v', got '%v'", "planet", val) + t.Fatalf("expecting '%v', got '%v'", "planet", val) } if err := db.Update(func(tx *Tx) error { tx.db = nil @@ -327,7 +327,7 @@ func TestVariousTx(t *testing.T) { t.Fatal(err) } if n != 5 { - t.Fatal("expecting %v, got %v", 5, n) + t.Fatalf("expecting %v, got %v", 5, n) } tx.db = nil _, err = tx.Len()