mattn/go-sqlite3 — pull request #22 by cdsks (2012-09-11 18:20:55+00:00)
Title: Fix sql.DB leaks in unit tests so that tests pass on vmware hgfs filesystem

Individual unit tests were unsuccessfully removing './foo.db' (the error was ignored) due to resource leaks, which caused everything but the first unit test to fail on my vmware hgfs filesystem. Adding the relevant defer statements for ```db.Close()``` and ```rows.Close()``` removed the leaks so that ```os.Remove()``` actually works.

*Minor fix:* ```t.Errorf("foo:", err)``` rewritten as ```t.Error("foo:", err) ```

The original, on error, yields:

sqlite3_test.go:42: Failed to create table:%!(EXTRA *errors.errorString=unable to open database file)

Corrected statement output:

sqlite3_test.go:42: Failed to create table: unable to open database file

*Minor fix:* Fixed single erroneous error message for sql.Open()

*Minor fix:* Replaced ```t.Error("..."); return``` with ```t.Fatal("...")```