mark2web/vendor/github.com/otiai10/copy/preserve_times.go

12 lines
214 B
Go
Raw Permalink Normal View History

2022-02-28 10:28:34 +01:00
package copy
import "os"
func preserveTimes(srcinfo os.FileInfo, dest string) error {
spec := getTimeSpec(srcinfo)
if err := os.Chtimes(dest, spec.Atime, spec.Mtime); err != nil {
return err
}
return nil
}