From 0c58aa844cc7343d063f24911d8d9876cbed647f Mon Sep 17 00:00:00 2001 From: Ulderico Cirello Date: Sun, 4 Aug 2024 23:15:24 -0700 Subject: [PATCH] pgqueue: remove unnecessary test for pgx.ErrNoRows --- queue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queue.go b/queue.go index c566bc7..951e3d5 100644 --- a/queue.go +++ b/queue.go @@ -228,7 +228,7 @@ func (c *Client) DumpDeadLetterQueue(ctx context.Context, queue string, n int) ( ) defer rows.Close() for rows.Next() { - if err := rows.Scan(&id, &content); err != nil && !errors.Is(err, pgx.ErrNoRows) { + if err := rows.Scan(&id, &content); err != nil { return fmt.Errorf("cannot read dead message: %w", err) } ids = append(ids, id) @@ -732,7 +732,7 @@ func (c *Client) PopN(ctx context.Context, queueName string, n int) ([][]byte, e defer rows.Close() for rows.Next() { var content []byte - if err := rows.Scan(&content); err != nil && !errors.Is(err, pgx.ErrNoRows) { + if err := rows.Scan(&content); err != nil { return fmt.Errorf("cannot pop message: %w", err) } contents = append(contents, content)