Use WriteTo() instead

This commit is contained in:
zounengren 2021-03-16 15:59:07 +08:00
parent 8f715c0917
commit cc6381f7d5

2
tx.go
View File

@ -393,7 +393,7 @@ func (tx *Tx) CopyFile(path string, mode os.FileMode) error {
return err
}
err = tx.Copy(f)
_, err = tx.WriteTo(f)
if err != nil {
_ = f.Close()
return err