From da58a9b0a6bb4523ee63f90b697bff7097751e56 Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Tue, 6 Jan 2015 19:17:45 -0600 Subject: [PATCH] Fix connection string printing format in debug mode --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 53c4dca..894b04f 100644 --- a/client.go +++ b/client.go @@ -32,8 +32,8 @@ type RowsOptions struct { func NewClient() (*Client, error) { str, err := buildConnectionString(options) - if options.Debug { - fmt.Println("Creating a new client with:", str) + if options.Debug && str != "" { + fmt.Println("Creating a new client for:", str) } if err != nil { @@ -57,7 +57,7 @@ func NewClient() (*Client, error) { func NewClientFromUrl(url string) (*Client, error) { if options.Debug { - fmt.Println("Creating a new client with: %s", url) + fmt.Println("Creating a new client for:", url) } db, err := sqlx.Open("postgres", url)