Fix connection string printing format in debug mode

This commit is contained in:
Dan Sosedoff
2015-01-06 19:17:45 -06:00
parent 165f411083
commit da58a9b0a6

View File

@@ -32,8 +32,8 @@ type RowsOptions struct {
func NewClient() (*Client, error) { func NewClient() (*Client, error) {
str, err := buildConnectionString(options) str, err := buildConnectionString(options)
if options.Debug { if options.Debug && str != "" {
fmt.Println("Creating a new client with:", str) fmt.Println("Creating a new client for:", str)
} }
if err != nil { if err != nil {
@@ -57,7 +57,7 @@ func NewClient() (*Client, error) {
func NewClientFromUrl(url string) (*Client, error) { func NewClientFromUrl(url string) (*Client, error) {
if options.Debug { 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) db, err := sqlx.Open("postgres", url)