
This linter checks for unnecessary type convertions. Some convertions are whitelisted because their type is different on 32bit platforms Signed-off-by: Daniel Nephin <dnephin@gmail.com>
20 lines
282 B
Go
20 lines
282 B
Go
// +build linux solaris darwin freebsd
|
|
|
|
package local
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
|
|
"github.com/containerd/containerd/sys"
|
|
)
|
|
|
|
func getATime(fi os.FileInfo) time.Time {
|
|
if st, ok := fi.Sys().(*syscall.Stat_t); ok {
|
|
return sys.StatATimeAsTime(st)
|
|
}
|
|
|
|
return fi.ModTime()
|
|
}
|