Conversation
user_plan9.go is almost identical to user_posix. test about failing bad connection is failing on plan9, more in a next commit.
i ran into this while adding plan9 support (postgres doesn't run on plan9). unrelated, this test is still broken on plan9: conn_test.go:769: expected use of closed error, got write tcp 192.168.178.144:55579->192.168.178.38:5432: bad arg in system call tcp closing apparently works slightly differently on plan9, where it doesn't return the error string expected by the tests. no big deal, and this patch improves the general situation.
conn_test.go
Outdated
| if port == "" { | ||
| port = "5432" | ||
| } | ||
| addr := host + ":" + port |
There was a problem hiding this comment.
net.JoinHostPort? (in case host is v6 for some reason)
would make it work with ipv6 ip addresses. suggested by roger chen in pull request comment.
|
can someone restart the build? |
Yes, in plan9 the standard environment variables are in lower case. See "$user" and "$home" in https://9p.io/magic/man2html/1/intro. But, it's probably fine to not make further changes. So, I suggest we just close this PR. Thanks for looking at this, and for |
|
Okay, I changed it to lower-case for Plan 9 with #1233. Maybe not necessary, but easy enough to do so might as well. |
Make this compile (and work) by adding a file user_plan9.go. It's nearly identical to the posix version.
On plan9 the test TestCloseBadConn in conn_test.go was failing. The hardcoded localhost:5432 won't work (postgres isn't available on plan9). The README already encourages you to use environment variables to override database connection parameters, so this patch makes the code look at env vars.