3 ms·
> because you actually have to think about them. Ok friend, but right here in this blog post is contrary evidence. The supposed "actual CopyFile function" ign
by topspin 4y ago
> because you actually have to think about them.
Ok friend, but right here in this blog post is contrary evidence. The supposed "actual CopyFile function" ignores errors from two deferred .Close()s at the io.Copy() call site. [1]
And this is idiomatic Go. It goes on every day and you can find thousands of examples of it all over GitHub et al. Solving for it quickly leads to a real eye-sore: a deferred closure or similar blight.
So if "think about them" is your aspiration then Go has failed.
[1] https://pkg.go.dev/os#File.Close https://pkg.go.dev/os#File.Close