Adds support for tinygo 0.32, thereby fixing https://github.com/philhofer/fwd/issues/29
Passes tests on macos intel:
- go 1.21.9:
- go test
- go 1.21.9 / tinygo 0.32 prerelease:
- tinygo test
- tinygo test -target wasi
I used go1.14 as version, to match other projects consuming this
module (e.g. github.com/tinylib/msgp).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The godoc2md tool has been deprecated, and is no longer maintained; it
has some bugs which prevent it from generating correct links (so I removed
those).
Added a badge to the documentation on pkg.go.dev, which perhaps should be
used as replacement for the docs in the README itself.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The (*Reader).Skip() code did not handle skip sizes
above the buffer size correctly, because the inner
reader loop only looped while 'r.buffered() < n', and
that condition is obviously violated when the reader
successfully buffers more bytes than are to be skipped.
Refactor this method to be a little shorter and hopefully
much clearer (and more correct) and add test coverage that
exercises this code better.
Some `io.Reader` instances can return `io.EOF` with a non-zero number of
bytes and will then return 0 bytes with the `io.EOF` error on the next
read. This interferes with the expectation that `io.EOF` meant that no
bytes had been read.
Discard the error and buffer the read data so these types of `io.Reader`
instances still work properly.
Fixes#13.
Before, if r.n == len(r.data), then r.data wouldn't be re-sliced
to r.data[:0], which would call Read() to be called with a smaller
buffer than necessary.