Skip to content

Make Dial return net.Conn interface, not custom struct. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2016

Conversation

dmitshur
Copy link
Member

@dmitshur dmitshur commented Apr 1, 2016


This simplifies the documentation and package slightly.

Remove WriteString method. It's a wrapper around Send method, and is not helpful in the context of a net.Conn, which deals with pure streams of bytes. To send text frames, either use a WebSocket and Send, or use type assertion to access the Send method from the returned net.Conn implementation (it embeds a WebSocket).

Resolves #11.

Apply minor style improvements, internal doc fixes.


This simplifies the documentation and package slightly.

Remove WriteString method. It's a wrapper around Send method, and is
not helpful in the context of a net.Conn, which deals with pure streams
of bytes. To send text frames, either use a WebSocket and Send, or use
type assertion to access the Send method from the returned net.Conn
implementation (it embeds a WebSocket).

Resolves #11.
@dmitshur dmitshur force-pushed the use-net-Conn-interface branch from 0779c4a to ead83e9 Compare April 1, 2016 04:56
@dmitshur
Copy link
Member Author

dmitshur commented Apr 1, 2016

Tests pass:

Tests completed in 1142 milliseconds.
11 assertions of 11 passed, 0 failed.

Also tested locally with a net.Conn-style use, worked without issues.

Use less naked returns. They're harder to read.
@dmitshur dmitshur force-pushed the use-net-Conn-interface branch from ead83e9 to 546cb25 Compare April 1, 2016 05:10
@mjohnson9
Copy link
Member

Will review later today.

@mjohnson9
Copy link
Member

LGTM. Merging. Sorry for the delay.

@mjohnson9 mjohnson9 merged commit edfe143 into master Apr 3, 2016
@dmitshur dmitshur deleted the use-net-Conn-interface branch April 3, 2016 02:21
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.

Should Dial return a net.Conn?
2 participants