github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/fstest/times_windows.go (about) 1 package fstest 2 3 import ( 4 "io/fs" 5 "syscall" 6 ) 7 8 func timesFromFileInfo(info fs.FileInfo) (atim, mtime int64) { 9 if d, ok := info.Sys().(*syscall.Win32FileAttributeData); ok { 10 return d.LastAccessTime.Nanoseconds(), d.LastWriteTime.Nanoseconds() 11 } else { 12 panic("unexpected") 13 } 14 }