[BREAKING CHANGE] v0.3.2: New Reader type to satisfy io.Reader
Initially the Msg
implemented a io.Reader
interface by providing a Read
methods. 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 a bufio.Reader
with 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 Reader
type. The Reader
type satisfies the io.Reader
interface and returns the data properly as well as returns EOF
in case the end of data is reached.
The initial Read()
method has been removed from the Msg
type and instead a NewReader()
method has been introduced that returns the Reader
type.
BREAKING CHANGE: Since we remove the Read
method from the Msg
the Msg
does not satisfy the io.Reader
interface 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
- Introduce golangci-lint by @wneessen in #66
- Fix codecov Go version setup by @wneessen in #67
- New Reader type by @wneessen in #68
Full Changelog: v0.3.1...v0.3.2