Commit 15e70e32 authored by zauberstuhl's avatar zauberstuhl
Browse files

Revert "Initialize structs before running enforceOneRow"

This reverts commit 9e3fdd7f.
parent 78b906a8
......@@ -140,8 +140,8 @@ func (u *Users) SensitiveUserByEmail(c util.Context, tx *sql.Tx, email string) (
return
}
defer rows.Close()
s = &SensitiveUser{}
return s, enforceOneRow(rows, "SensitiveUserByEmail", func(r SingleRow) error {
s = &SensitiveUser{}
return r.Scan(&(s.ID), &(s.Hashpass), &(s.Salt))
})
}
......@@ -154,8 +154,8 @@ func (u *Users) UserByID(c util.Context, tx *sql.Tx, id string) (s *User, err er
return
}
defer rows.Close()
s = &User{}
return s, enforceOneRow(rows, "UserByID", func(r SingleRow) error {
s = &User{}
return r.Scan(&(s.ID), &(s.Email), &(s.Actor), &(s.Privileges), &(s.Preferences))
})
}
......@@ -169,8 +169,8 @@ func (u *Users) UserByPreferredUsername(c util.Context, tx *sql.Tx, name string)
return
}
defer rows.Close()
s = &User{}
return s, enforceOneRow(rows, "UserByID", func(r SingleRow) error {
s = &User{}
return r.Scan(&(s.ID), &(s.Email), &(s.Actor), &(s.Privileges), &(s.Preferences))
})
}
......@@ -183,8 +183,8 @@ func (u *Users) InstanceActorUser(c util.Context, tx *sql.Tx) (s *User, err erro
return
}
defer rows.Close()
s = &User{}
return s, enforceOneRow(rows, "Users.InstanceActorUser", func(r SingleRow) error {
s = &User{}
return r.Scan(&(s.ID), &(s.Email), &(s.Actor), &(s.Privileges), &(s.Preferences))
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment