Revert "Accidentally got false and true mixed up in checkUsernameTaken"
This reverts commit 7dfa018fe6
.
This commit is contained in:
parent
d833d90c59
commit
73506b8aee
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)
|
||||
if err != nil {
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return 0, false, nil
|
||||
return 0, true, nil
|
||||
} else {
|
||||
return 0, true, err
|
||||
}
|
||||
}
|
||||
|
||||
return id, true, nil
|
||||
return id, false, nil
|
||||
}
|
||||
|
||||
func init_db() {
|
||||
|
|
Reference in New Issue