2
0

Fix docs for listen / notify

https://github.com/jackc/pgx/issues/1318
This commit is contained in:
Jack Christensen
2022-10-01 12:58:49 -05:00
parent 222e3b37bc
commit f803c790d0
+5 -3
View File
@@ -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