mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-09 13:05:36 +02:00
``` * use go 1.17 semantics in go.mod * pin tonistiigi/fsutil dep to match docker/docker's dep go get -u ./... go mod vendor ```
20 lines
339 B
Go
20 lines
339 B
Go
// +build darwin
|
|
|
|
package copy
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func getTimeSpec(info os.FileInfo) timespec {
|
|
stat := info.Sys().(*syscall.Stat_t)
|
|
times := timespec{
|
|
Mtime: info.ModTime(),
|
|
Atime: time.Unix(stat.Atimespec.Sec, stat.Atimespec.Nsec),
|
|
Ctime: time.Unix(stat.Ctimespec.Sec, stat.Ctimespec.Nsec),
|
|
}
|
|
return times
|
|
}
|