func unlistenAndRelease(pool *pgx.ConnPool, conn *pgx.Conn, channel string) { if err := conn.Unlisten(channel); err != nil { conn.Close() } pool.Release(conn) }
func closeConn(t testing.TB, conn *pgx.Conn) { err := conn.Close() if err != nil { t.Fatalf("conn.Close unexpectedly failed: %v", err) } }