Default to localhost if not linux or BSD

This commit is contained in:
Matthew Wraith 2021-08-06 15:33:56 -07:00
parent 0fd7f79820
commit cf59ceac74
2 changed files with 6 additions and 6 deletions

View file

@ -50,12 +50,12 @@ func connectionString(u *url.URL) string {
// default hostname
if hostname == "" {
switch runtime.GOOS {
case "windows":
hostname = "localhost"
case "linux":
query.Set("host", "/var/run/postgresql")
default:
case "darwin", "freebsd", "dragonfly", "openbsd", "netbsd":
query.Set("host", "/tmp")
default:
hostname = "localhost"
}
}