-
Notifications
You must be signed in to change notification settings - Fork 2.7k
deprecate ReadSeekCloser in favor of io.ReadSeekCloser #3788
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
deprecate ReadSeekCloser in favor of io.ReadSeekCloser #3788
Conversation
d42e1bf
to
bcf144b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that distribution.ReadSeekCloser
is now type aliased to io.ReadSeekCloser
but I still wonder if many of these func
s should be returning io.ReadSeekCloser
instead of distribution.ReadSeekCloser
; seems like type aliasing does the trick and we dont need to change those return values. Is the reason for that change to be explicit about the type we return
The
But, at the time, Go was still at version 1.4, and Line 1 in 593bbcc
While the alias would "work", it would prevent us from removing it. Using |
Go's io package in stdlib now defines this interface, so we can switch to using that instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…Closer General convention is to define interfaces on the receiver side, and to return concrete types. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Remove some intermediate variables, and use struct literals instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
bcf144b
to
1d8cd5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I didn't see if there is a project commitment to compile on older golang versions.
We should document this publicly 💯 Ideally, we should not go far back wrt to supporting older versions - it's an actual nightmare sometimes to be b/w compatible to ancient version. |
Go recommendation is to support current + previous (which are the only "supported" versions). I think it's ok if we go for try to support "last 3 versions" (as some projects may be lingering slightly behind), but we should clearly document that to be a "best effort". |
@corhere PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Go's io package in stdlib now defines this interface, so we can switch to using that instead. Also doing some minor cleanup.
The remaining use of this interface is removed in #3787