Skip to content

Conversation

@mjl-
Copy link
Contributor

@mjl- mjl- commented Apr 23, 2018

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.

mjl- added 2 commits April 23, 2018 15:00
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@mjl-
Copy link
Contributor Author

mjl- commented Apr 25, 2018

can someone restart the build?
it failed due to golint missing (externally, which has been fixed, see golang/lint#397).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants