Closed rgarlik closed 2 years ago
It seems a blank string is supposed to connect you to a local instance of Postgres and this is expected behavior, my mistake, I'll dig in a little deeper before opening an issue next time. Sorry for wasting your time.
Calling the
sql.Open
function returns an empty error object when the connection string is empty. Incorrect connection string should provide some sort of error even ifsql.Open
does not attempt a database connection by itself.Example code:
produces the following output:
Attempting to
Ping()
the created database will result in a not-very-helpful error message after attempting to connect to a default configuration:Tested on
go1.19 windows/amd64