We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 931b5ae + 16412e5 commit f91d341Copy full SHA for f91d341
1 file changed
conn_test.go
@@ -724,7 +724,15 @@ func TestBadConn(t *testing.T) {
724
// TestCloseBadConn tests that the underlying connection can be closed with
725
// Close after an error.
726
func TestCloseBadConn(t *testing.T) {
727
- nc, err := net.Dial("tcp", "localhost:5432")
+ host := os.Getenv("PGHOST")
728
+ if host == "" {
729
+ host = "localhost"
730
+ }
731
+ port := os.Getenv("PGPORT")
732
+ if port == "" {
733
+ port = "5432"
734
735
+ nc, err := net.Dial("tcp", host+":"+port)
736
if err != nil {
737
t.Fatal(err)
738
}
0 commit comments