Closed krum110487 closed 2 weeks ago
changing the function return signature isn't a backwards compatible change. you can type assert if you need the other methods
changing the function return signature isn't a backwards compatible change. you can type assert if you need the other methods
I modified my post, I meant to put "ReadSeeker" it has been updated. Since it also implements reader, wouldn't it work fine and be backwards compatible since it implements the functions?
OH! so I can just do this?
r,_ := f.OpenRaw()
return r.(io.ReadSeeker), nil
Proposal Details
Right now as implemented in OpenRaw() it uses a NewSectionReader to return a reader so that it could have a Read, Seek and ReadAt, but for whatever reason it is returning just an io.Reader implementation meaning that with OpenRaw it is not seekable.
Is there a good reason why the function returns
io.Reader
and notio.ReadSeeker
so we can have more access to the bytes?It seems like a very easy modification from:
to