From f803c790d0999e9028cbffefad9df02e4aff913a Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 1 Oct 2022 12:58:49 -0500 Subject: [PATCH] Fix docs for listen / notify https://github.com/jackc/pgx/issues/1318 --- doc.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc.go b/doc.go index 497ab660..430f16ed 100644 --- a/doc.go +++ b/doc.go @@ -161,12 +161,14 @@ notification is received or the context is canceled. _, err := conn.Exec(context.Background(), "listen channelname") if err != nil { - return nil + return err } - if notification, err := conn.WaitForNotification(context.Background()); err != nil { - // do something with notification + notification, err := conn.WaitForNotification(context.Background()) + if err != nil { + return err } + // do something with notification Tracing and Logging