We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5674e19 commit 1ae6ca7Copy full SHA for 1ae6ca7
sqlite3_test/sqltest.go
@@ -275,12 +275,11 @@ func TestPreparedStmt(t *testing.T) {
275
}
276
277
const nRuns = 10
278
- ch := make(chan bool)
+ var wg sync.WaitGroup
279
for i := 0; i < nRuns; i++ {
280
+ wg.Add(1)
281
go func() {
- defer func() {
282
- ch <- true
283
- }()
+ defer wg.Done()
284
for j := 0; j < 10; j++ {
285
count := 0
286
if err := sel.QueryRow().Scan(&count); err != nil && err != sql.ErrNoRows {
@@ -294,9 +293,7 @@ func TestPreparedStmt(t *testing.T) {
294
293
295
}()
296
297
- for i := 0; i < nRuns; i++ {
298
- <-ch
299
- }
+ wg.Wait()
300
301
302
// Benchmarks need to use panic() since b.Error errors are lost when
0 commit comments