Do not catch norows error

This commit is contained in:
Sebastiaan de Schaetzen 2025-05-13 19:26:37 +02:00
parent f29eeae9d9
commit dd942f12f7

View File

@ -51,9 +51,6 @@ func (db *Db) GetUser(id int) (*UserWithAllowance, error) {
err := db.db.Query("select u.id, u.name, sum(h.amount) from users u join history h on h.user_id = u.id where u.id = ?").
Bind(id).ScanSingle(&user.ID, &user.Name, &user.Allowance)
if errors.Is(err, mysqlite.ErrNoRows) {
return nil, nil
}
if err != nil {
return nil, err
}