4 ms·
You can just expose two different functions, one of which takes a byte slice and one of which takes an io.Reader. Given how the code works (it starts by buffer
by foldr 1y ago
You can just expose two different functions, one of which takes a byte slice and one of which takes an io.Reader.
Given how the code works (it starts by buffering the input stream), the second function will just be a few lines of code followed by a call to the first.
Perfect example of how complex type systems can lead people to have unnecessarily complex thoughts.