Fixed argument passing as variadic.

This commit is contained in:
Gergely Brautigam 2016-01-31 15:00:31 +01:00
parent cfcec48ca4
commit d2e2d035f2
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ func (db Database) prepare(q string) (stmt *sql.Stmt) {
}
func (db Database) query(q string, args ...interface{}) (rows *sql.Rows) {
rows, err := db.db.Query(q, args)
rows, err := db.db.Query(q, args...)
if err != nil {
log.Println(err)
}
@ -165,7 +165,7 @@ func UpdateTask(id int, title string, content string) error {
func taskQuery(sql string, args ...interface{}) error {
SQL := database.prepare("update task set title=?, content=? where id=?")
tx := database.begin()
_, err = tx.Stmt(SQL).Exec(args)
_, err = tx.Stmt(SQL).Exec(args...)
if err != nil {
log.Println(err)
tx.Rollback()