Skip to content

Commit

Permalink
Fix go vet warning in TestConcurrentAdd
Browse files Browse the repository at this point in the history
Before:
```
./skl_test.go:486: loop variable f captured by func literal
```
  • Loading branch information
nvanbenschoten committed Mar 10, 2019
1 parent 224761e commit 4f78fa9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,23 +475,23 @@ func TestConcurrentAdd(t *testing.T) {
}

for f := 0; f < 2; f++ {
go func() {
go func(id int) {
var it Iterator
it.Init(l)

for i := 0; i < n; i++ {
start[i].Wait()

key := newValue(i)
val := []byte(fmt.Sprintf("%d: %05d", f, i))
val := []byte(fmt.Sprintf("%d: %05d", id, i))
if it.Add(key, val, 0) == nil {
it.Seek(key)
require.EqualValues(t, val, it.Value())
}

end[i].Done()
}
}()
}(f)
}

for i := 0; i < n; i++ {
Expand Down

0 comments on commit 4f78fa9

Please sign in to comment.