[BREAKING CHANGE] v0.3.2: New Reader type to satisfy io.Reader #69
Closed
wneessen
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Initially the
Msgimplemented aio.Readerinterface by providing aReadmethods. Unfortunately the method chosen for this method was very naive. It works fine for smaller messages but could result in wrong data returned for larger messages or i. e. used in abufio.Readerwith non consecutive reads. Since we did not track the position and state of the reading operation, duplicate data might be returned to the caller eventually even leading into infinite loops.This release fixes the issue be introducing a new
Readertype. TheReadertype satisfies theio.Readerinterface and returns the data properly as well as returnsEOFin case the end of data is reached.The initial
Read()method has been removed from theMsgtype which and instead aNewReader()method has been introduced that returns theReadertype.BREAKING CHANGE: Since we remove the
Readmethod from theMsgtheMsgdoes not satisfy theio.Readerinterface anymore, which is considered a breaking change. But given that the returned data of the original implementation might return duplicate or wrong data, this breaking change is considered as the right decision.What's Changed
Full Changelog: v0.3.1...v0.3.2
This discussion was created from the release [BREAKING CHANGE] v0.3.2: New Reader type to satisfy io.Reader.
Beta Was this translation helpful? Give feedback.
All reactions