So readerSkip has been replaced with a copy to ioutil.Discard.
In addition, error checking for Seek has been added.
I've taken the liberty of removing some convenience definitions
because some of them just aliased standard library functions
making it harder to understand the code and spot that there were
unchecked errors. This also shortens the code.
This code had a race in it, which actually Go itself once had in
ioutil.Discard
but subsequently got fixed:https://github.com/golang/go/issues/4589
So
readerSkip
has been replaced with a copy toioutil.Discard
.In addition, error checking for
Seek
has been added.I've taken the liberty of removing some convenience definitions because some of them just aliased standard library functions making it harder to understand the code and spot that there were unchecked errors. This also shortens the code.