diff options
author | Joe Robinson <joe@mumsnet.com> | 2014-07-21 10:20:48 +0100 |
---|---|---|
committer | Joe Robinson <joe@mumsnet.com> | 2014-07-21 10:20:48 +0100 |
commit | bfbd9cbdc79d0af254ee387ae840efe4702b2b3e (patch) | |
tree | a5e120e9506da8360aabf31b509c9a569c29c1d0 /user.go | |
parent | 9c64140e68d236b6b8bbe90157b60cb9eb35506d (diff) |
Check if user is an admin or added the poll to allow them to remove one
Diffstat (limited to 'user.go')
-rw-r--r-- | user.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3,7 +3,7 @@ package main import "github.com/mxk/go-sqlite/sqlite3" type User struct { - id int + id int64 name string isAdmin bool } @@ -28,7 +28,7 @@ func getUserForId(db *sqlite3.Conn, id int) User { row := make(sqlite3.RowMap) for ; err == nil ; err = s.Next() { - var rowid int + var rowid int64 s.Scan(&rowid, row) // Assigns 1st column to rowid, the rest to row user := User{id:rowid, name:row["name"].(string), isAdmin:row["admin"].(bool)} @@ -48,7 +48,7 @@ func getUserForName(db *sqlite3.Conn, name string) User { row := make(sqlite3.RowMap) for ; err == nil ; err = s.Next() { - var rowid int + var rowid int64 s.Scan(&rowid, row) user := User{id:rowid, name:row["name"].(string), isAdmin:row["admin"].(bool)} |