Skip to content

Commit

Permalink
test: add buffer to a channel to avoid the goroutine leak
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhfromustc committed Mar 24, 2021
1 parent f6be823 commit 981093d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ func TestDB_Batch(t *testing.T) {

// Iterate over multiple updates in separate goroutines.
n := 2
ch := make(chan error)
ch := make(chan error, n)
for i := 0; i < n; i++ {
go func(i int) {
ch <- db.Batch(func(tx *bolt.Tx) error {
Expand Down

0 comments on commit 981093d

Please sign in to comment.