Closed Jacalz closed 1 year ago
The code can be simplified to take in an io.ReadCloser and then close the file where necessary instead. Doing it this way avoids having to spin up a goroutine and intercept the channel to then send the information through another channel.
I find the existing code to be more clear. The owner function of the file takes responsibility for closing the file.
The code can be simplified to take in an io.ReadCloser and then close the file where necessary instead. Doing it this way avoids having to spin up a goroutine and intercept the channel to then send the information through another channel.