From e014539cde33ff2deb16960800e38ac21670d960 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Fri, 20 Jun 2014 14:03:34 -0500 Subject: [PATCH] Fix example url_shortener --- examples/url_shortener/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/url_shortener/main.go b/examples/url_shortener/main.go index 29f2e40c..53c988ec 100644 --- a/examples/url_shortener/main.go +++ b/examples/url_shortener/main.go @@ -12,14 +12,14 @@ var pool *pgx.ConnPool // afterConnect creates the prepared statements that this application uses func afterConnect(conn *pgx.Conn) (err error) { - err = conn.Prepare("getUrl", ` + _, err = conn.Prepare("getUrl", ` select url from shortened_urls where id=$1 `) if err != nil { return } - err = conn.Prepare("deleteUrl", ` + _, err = conn.Prepare("deleteUrl", ` delete from shortened_urls where id=$1 `) if err != nil { @@ -30,7 +30,7 @@ func afterConnect(conn *pgx.Conn) (err error) { // where one of two simultaneous requests to the shortened URL would fail // with a unique index violation. As the point of this demo is pgx usage and // not how to perfectly upsert in PostgreSQL it is deemed acceptable. - err = conn.Prepare("putUrl", ` + _, err = conn.Prepare("putUrl", ` with upsert as ( update shortened_urls set url=$2