diff --git a/bench_test.go b/bench_test.go index e1e9903..ce1ec09 100644 --- a/bench_test.go +++ b/bench_test.go @@ -93,7 +93,7 @@ func BenchmarkOneByID(b *testing.B) { defer cleanup() type User struct { - ID int + ID int `storm:"increment"` Name string `storm:"index"` age int DateOfBirth time.Time `storm:"index"` diff --git a/store_test.go b/store_test.go index f850ef2..784f394 100644 --- a/store_test.go +++ b/store_test.go @@ -9,8 +9,8 @@ import ( "github.com/asdine/storm/codec/gob" "github.com/asdine/storm/codec/json" "github.com/asdine/storm/q" - bolt "go.etcd.io/bbolt" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" ) func TestInit(t *testing.T) { @@ -423,11 +423,11 @@ func TestSaveWithBatch(t *testing.T) { for i := 0; i < 5; i++ { wg.Add(1) - go func() { + go func(i int) { defer wg.Done() err := db.Save(&User{ID: i + 1, Name: "John"}) require.NoError(t, err) - }() + }(i) } wg.Wait() diff --git a/structs_test.go b/structs_test.go index b229004..a44cfe5 100644 --- a/structs_test.go +++ b/structs_test.go @@ -62,7 +62,7 @@ type ClassicInline struct { } type User struct { - ID int `storm:"id"` + ID int `storm:"id,increment"` Name string `storm:"index"` Age int `storm:"index,increment"` DateOfBirth time.Time `storm:"index"`