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

io: SectionReader.ReaderAt not returning EOF when end of section hit #4392

Closed
gopherbot opened this issue Nov 15, 2012 · 3 comments
Closed
Milestone

Comments

@gopherbot
Copy link

by sam@eversoft.co.nz:

Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

Run "go version" and compare against
http://golang.org/doc/devel/release.html  If a newer version of Go exists,
install it and retry what you did to reproduce the problem.

Thanks.

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. http://play.golang.org/p/-4L5yBHnhX

What is the expected output?
1 EOF

What do you see instead?
1 <nil>

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
OSX

Which version are you using?  (run 'go version')
go version go1.0.3

Please provide any additional information below.
The reason I believe the current output is incorrect is the docs on io.ReaderAt,
specifically (from http://golang.org/pkg/io/#ReaderAt)

" When ReadAt returns n < len(p), it returns a non-nil error explaining why more
bytes were not returned. In this respect, ReadAt is stricter than Read. "

The current source for io.go reduces the size of the underlying ReadAt to match the size
of the section. This means that EOF is never returned (except sometimes if the section
lines up with the end of the file).
@minux
Copy link
Member

minux commented Nov 23, 2012

Comment 1:

Labels changed: added priority-later, removed priority-triage.

Owner changed to @minux.

Status changed to Accepted.

@minux
Copy link
Member

minux commented Nov 23, 2012

Comment 2:

https://golang.org/cl/6858062/

Status changed to Started.

@minux
Copy link
Member

minux commented Dec 13, 2012

Comment 3:

This issue was closed by revision 31eedd7.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants