Accidentally got false and true mixed up in checkUsernameTaken
This commit is contained in:
parent
5f8bf52194
commit
7dfa018fe6
4
main.go
4
main.go
|
@ -148,13 +148,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, true, nil
|
||||
return 0, false, nil
|
||||
} else {
|
||||
return 0, true, err
|
||||
}
|
||||
}
|
||||
|
||||
return id, false, nil
|
||||
return id, true, nil
|
||||
}
|
||||
|
||||
func init_db() {
|
||||
|
|
Reference in New Issue