Fixed silly error in checkusernametaken
This commit is contained in:
parent
d04785d2d3
commit
14deebd553
4
main.go
4
main.go
|
@ -147,13 +147,13 @@ func checkUsernameTaken(username string) (int, bool, error) {
|
||||||
err := conn.QueryRow("SELECT id FROM users WHERE lower(username) = ? LIMIT 1", username).Scan(&id)
|
err := conn.QueryRow("SELECT id FROM users WHERE lower(username) = ? LIMIT 1", username).Scan(&id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, sql.ErrNoRows) {
|
if errors.Is(err, sql.ErrNoRows) {
|
||||||
return 0, true, nil
|
return 0, false, nil
|
||||||
} else {
|
} else {
|
||||||
return 0, true, err
|
return 0, true, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return id, false, nil
|
return id, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func init_db() {
|
func init_db() {
|
||||||
|
|
Reference in New Issue