News for hackers. Stuff that matters.
Re:Too Much Go Misdirection by foldr on Tuesday May 20, 2025 @06:16AM (#44039854)
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.

There are no comments on this comment yet.