mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 14:36:03 +02:00
* Bump github.com/docker/docker to latest release * Pin deps to docker/docker's requirements fix build breakages fix unit test Trying to see whether am-i-in-a-container checks are broken for integration tests...
23 lines
346 B
Go
23 lines
346 B
Go
// +build !linux
|
|
|
|
package fsutil
|
|
|
|
import (
|
|
"os"
|
|
"time"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func chtimes(path string, un int64) error {
|
|
mtime := time.Unix(0, un)
|
|
fi, err := os.Lstat(path)
|
|
if err != nil {
|
|
return errors.WithStack(err)
|
|
}
|
|
if fi.Mode()&os.ModeSymlink != 0 {
|
|
return nil
|
|
}
|
|
return errors.WithStack(os.Chtimes(path, mtime, mtime))
|
|
}
|