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

net/http: remove "Seek" from File interface, replace with "io.Seeker" #13421

Closed
xoba opened this issue Nov 28, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@xoba
Copy link
Contributor

commented Nov 28, 2015

this merely simplifies the interface a bit (no change in functionality) and makes further connection to the io package, which seems appropriate:

type File interface {
        io.Closer
        io.Reader
        io.Seeker // ADD THIS
        Readdir(count int) ([]os.FileInfo, error)
        // Seek(offset int64, whence int) (int64, error) // REMOVE THIS
        Stat() (os.FileInfo, error)
}

not sure if there are any policy reasons why this change couldn't be made, like strict api compatibility, etc.

@rakyll rakyll changed the title remove "Seek" from net/http.File interface, replace with "io.Seeker" net/http: remove "Seek" from File interface, replace with "io.Seeker" Nov 28, 2015

@rakyll

This comment has been minimized.

Copy link
Member

commented Nov 28, 2015

Why not grouping io.Reader and Seek into io.ReadSeeker?

@gopherbot

This comment has been minimized.

Copy link

commented Nov 28, 2015

CL https://golang.org/cl/17250 mentions this issue.

@xoba

This comment has been minimized.

Copy link
Contributor Author

commented Nov 28, 2015

sounds good to me, i guess either io.ReadSeeker+io.Closer (your CL), or io.ReadCloser+io.Seeker could work? only reason i didn't suggest it at first, is for some reason io.Closer and io.Reader weren't already combined into io.ReadCloser. anyone out there know the reasoning, if any, around that?

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Nov 29, 2015

@rakyll rakyll closed this in afc2c45 Nov 30, 2015

@golang golang locked and limited conversation to collaborators Dec 1, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.