summaryrefslogtreecommitdiff
path: root/user.go
diff options
context:
space:
mode:
authorJoe Robinson <joe@mumsnet.com>2014-07-21 10:20:48 +0100
committerJoe Robinson <joe@mumsnet.com>2014-07-21 10:20:48 +0100
commitbfbd9cbdc79d0af254ee387ae840efe4702b2b3e (patch)
treea5e120e9506da8360aabf31b509c9a569c29c1d0 /user.go
parent9c64140e68d236b6b8bbe90157b60cb9eb35506d (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.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/user.go b/user.go
index d1ed261..b686f74 100644
--- a/user.go
+++ b/user.go
@@ -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)}