Closed fuweid closed 1 year ago
I wonder if we could just get rid of this function all together, for unix we still do
func copyFileContent(dst, src *os.File) error {
buf := bufferPool.Get().(*[]byte)
_, err := io.CopyBuffer(dst, src, *buf)
bufferPool.Put(buf)
return err
}
Based on the Go code though, this buffer will never be used for os.File to os.File copying though https://github.com/golang/go/blob/master/src/os/file.go#L161
I wonder if we could just get rid of this function all together
If the go runtime move the .ReadFrom
into linux platform, I guess it will be possible
Updated. Please take a look.
REF: https://github.com/golang/go/commit/7be3f09deb2dc1d57cfc18b18e12192be3544794