fix tests

This commit is contained in:
Yasuhiro Matsumoto 2016-12-09 12:58:20 +09:00
parent a160bbbc09
commit 35cf400919
1 changed files with 2 additions and 2 deletions

View File

@ -29,12 +29,12 @@ func TestNamedParams(t *testing.T) {
t.Error("Failed to call db.Query:", err) t.Error("Failed to call db.Query:", err)
} }
_, err = db.Exec(`insert into foo(id, name, extra) values(:id, :name, :name)`, sql.Named(":name", "foo"), sql.Named(":id", 1)) _, err = db.Exec(`insert into foo(id, name, extra) values(:id, :name, :name)`, sql.Named("name", "foo"), sql.Named("id", 1))
if err != nil { if err != nil {
t.Error("Failed to call db.Exec:", err) t.Error("Failed to call db.Exec:", err)
} }
row := db.QueryRow(`select id, extra from foo where id = :id and extra = :extra`, sql.Named(":id", 1), sql.Named(":extra", "foo")) row := db.QueryRow(`select id, extra from foo where id = :id and extra = :extra`, sql.Named("id", 1), sql.Named("extra", "foo"))
if row == nil { if row == nil {
t.Error("Failed to call db.QueryRow") t.Error("Failed to call db.QueryRow")
} }