diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2015-11-02 11:53:42 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2015-11-02 11:53:42 +0900 |
commit | 167173a31f6bde3b86bbbcbe8fdac4843f34c0ef (patch) | |
tree | c2e8e8b33a6bad98d5023189d939fb1ba58dcb2f /sqlite3_test/sqltest.go | |
parent | Add FTS4 unicode61 tokenizer support (diff) | |
parent | Cosmetics: use WaitGroup instead of channel in test (diff) | |
download | golite-167173a31f6bde3b86bbbcbe8fdac4843f34c0ef.tar.gz golite-167173a31f6bde3b86bbbcbe8fdac4843f34c0ef.tar.xz |
Merge branch 'pr/207'
Diffstat (limited to 'sqlite3_test/sqltest.go')
-rw-r--r-- | sqlite3_test/sqltest.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sqlite3_test/sqltest.go b/sqlite3_test/sqltest.go index 782e15f..84b65d9 100644 --- a/sqlite3_test/sqltest.go +++ b/sqlite3_test/sqltest.go @@ -275,12 +275,11 @@ func TestPreparedStmt(t *testing.T) { } const nRuns = 10 - ch := make(chan bool) + var wg sync.WaitGroup for i := 0; i < nRuns; i++ { + wg.Add(1) go func() { - defer func() { - ch <- true - }() + defer wg.Done() for j := 0; j < 10; j++ { count := 0 if err := sel.QueryRow().Scan(&count); err != nil && err != sql.ErrNoRows { @@ -294,9 +293,7 @@ func TestPreparedStmt(t *testing.T) { } }() } - for i := 0; i < nRuns; i++ { - <-ch - } + wg.Wait() } // Benchmarks need to use panic() since b.Error errors are lost when |