(b *testing.B)
| 233 | } |
| 234 | |
| 235 | func BenchmarkQueryRowScan(b *testing.B) { |
| 236 | db := benchmarkDB() |
| 237 | defer db.Close() |
| 238 | |
| 239 | b.ResetTimer() |
| 240 | |
| 241 | b.RunParallel(func(pb *testing.PB) { |
| 242 | for pb.Next() { |
| 243 | var n int64 |
| 244 | _, err := db.QueryOne(pg.Scan(&n), `SELECT ? AS num`, 1) |
| 245 | if err != nil { |
| 246 | b.Fatal(err) |
| 247 | } |
| 248 | if n != 1 { |
| 249 | b.Fatalf("got %d, wanted 1", n) |
| 250 | } |
| 251 | } |
| 252 | }) |
| 253 | } |
| 254 | |
| 255 | func BenchmarkQueryRowStmtScan(b *testing.B) { |
| 256 | db := benchmarkDB() |
nothing calls this directly
no test coverage detected
searching dependent graphs…