Skip to content
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

Implement io.Writer #7

Open
bramvdbogaerde opened this issue Jul 24, 2016 · 1 comment
Open

Implement io.Writer #7

bramvdbogaerde opened this issue Jul 24, 2016 · 1 comment

Comments

@bramvdbogaerde
Copy link

The conn struct almost implements io.Writer, it only differs from the number of return values.

    *sse.Conn does not implement io.Writer (wrong type for Write method)
        have Write([]byte) error
        want Write([]byte) (int, error)

Is there a special reason why it is this way?
I think it would be useful to make the Conn implement io.Writer.

Thanks.

@JanBerktold
Copy link
Owner

Sadly, the architecture makes it quite to hard to get the exact # of bytes written back to the initiating function call.

An option would be to return a fake value (e.g. 0) just for the sake of implementing the interface and trust that nobody is attempting to use it.

Will look into this tomorrow-ish, might find a way to cleverly implement it.

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

No branches or pull requests

2 participants