Skip to content

Commit

Permalink
notifier: Avoid double reference
Browse files Browse the repository at this point in the history
I guess the pgx lib changed to not account for this.

Signed-off-by: crozzy <[email protected]>
(cherry picked from commit 5446e49)
  • Loading branch information
crozzy authored and hdonnay committed Apr 5, 2023
1 parent e02aba2 commit ffa4556
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions notifier/postgres/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ func (s *Store) Notifications(ctx context.Context, id uuid.UUID, page *notifier.
for rows.Next() {
ns = append(ns, notifier.Notification{})
n := &ns[len(ns)-1]
if err := rows.Scan(&n.ID, &n); err != nil {
if err := rows.Scan(&n.ID, n); err != nil {
return err
}
}

if err := rows.Err(); err != nil {
return err
}
Expand Down Expand Up @@ -164,7 +165,7 @@ func (s *Store) Notifications(ctx context.Context, id uuid.UUID, page *notifier.
for rows.Next() {
ns = append(ns, notifier.Notification{})
n := &ns[len(ns)-1]
if err := rows.Scan(&n.ID, &n); err != nil {
if err := rows.Scan(&n.ID, n); err != nil {
return err
}
}
Expand Down

0 comments on commit ffa4556

Please sign in to comment.