From d2e2d035f265537b15348ec395d9800e24d1b947 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam Date: Sun, 31 Jan 2016 15:00:31 +0100 Subject: [PATCH] Fixed argument passing as variadic. --- db/tasks.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/tasks.go b/db/tasks.go index 326ba32..2b911b2 100644 --- a/db/tasks.go +++ b/db/tasks.go @@ -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()