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

clnt.File superficially implements io.Writer #42

Open
aarzilli opened this issue Dec 28, 2015 · 1 comment
Open

clnt.File superficially implements io.Writer #42

aarzilli opened this issue Dec 28, 2015 · 1 comment

Comments

@aarzilli
Copy link

io.Writer says that Write must return a non-nil error if it returns n < len(p) but clnt.(*File).Write can return n < len(buf) and nil as an error.

The effect is that using a clnt.File with something that takes an io.Writer, like io.Copy, will compile and appear to work correctly until a large write (>4kb?) is attempted, and then break.

@aarzilli
Copy link
Author

IMHO Write should either be made conform with io.Writer, removed entirely, or the documentation should have a big warning about using Files as io.Writers.

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

1 participant