Comment on Zero-copy in Go: sendfile, splice, and the cost of io.CopyComments−mike_hock2moZero-Copy in Go: Why magic is an antipattern, and: performance is observable behavior.−sanxiyn2moWhat would you prefer?I do think it is criminal this is not documented (https://pkg.go.dev/io#Copy), but I think io.Copy is fine as an API.−arccy2moit is documented by saying it calls ReadFrom or WriteTo−sanxiyn2moSure, but it could be more explicit. See Rust for how it should be done.
Comments
Zero-Copy in Go: Why magic is an antipattern, and: performance is observable behavior.
What would you prefer?
I do think it is criminal this is not documented (https://pkg.go.dev/io#Copy), but I think io.Copy is fine as an API.
it is documented by saying it calls ReadFrom or WriteTo
Sure, but it could be more explicit. See Rust for how it should be done.