Explorar el Código

close connection

Arne Hormann hace 12 años
padre
commit
014e34c949
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      benchmark_test.go

+ 2 - 0
benchmark_test.go

@@ -16,6 +16,7 @@ func BenchmarkRoundtripText(b *testing.B) {
 	if err != nil {
 		b.Fatalf("crashed")
 	}
+	defer db.Close()
 	var result string
 	for i := 0; i < b.N; i++ {
 		length := 16 + i%(4*b.N)
@@ -46,6 +47,7 @@ func BenchmarkRoundtripPrepared(b *testing.B) {
 	if err != nil {
 		b.Fatalf("crashed")
 	}
+	defer db.Close()
 	var result string
 	stmt, err := db.Prepare("SELECT ?")
 	if err != nil {