Fix error comparisons

This commit is contained in:
Deluan
2022-09-30 18:54:25 -04:00
parent 7b0a8f47de
commit db67c1277e
27 changed files with 93 additions and 73 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package persistence
import (
"context"
"errors"
"time"
. "github.com/Masterminds/squirrel"
@@ -59,7 +60,7 @@ func (r *scrobbleBufferRepository) Next(service string, userId string) (*model.S
res := model.ScrobbleEntries{}
// TODO Rewrite queryOne to use QueryRows, to workaround the recursive embedded structs issue
err := r.queryAll(sql, &res)
if err == model.ErrNotFound || len(res) == 0 {
if errors.Is(err, model.ErrNotFound) || len(res) == 0 {
return nil, nil
}
if err != nil {