From c3a165e64af65e89715140805d6ad1e9b7e4ba07 Mon Sep 17 00:00:00 2001 From: 兔子 Date: Tue, 22 Dec 2020 09:27:55 +0800 Subject: [PATCH] bug fix:struct error while get file creation date --- files_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files_unix.go b/files_unix.go index d5a972d..013182c 100644 --- a/files_unix.go +++ b/files_unix.go @@ -13,9 +13,9 @@ func timespecToTime(ts syscall.Timespec) time.Time { } func GetFileCreationTime(fileinfo os.FileInfo) time.Time { - return timespecToTime(stat_t.Ctim) + return timespecToTime(fileinfo.Sys().(*syscall.Stat_t).Ctim) } func GetFileAccessTime(fileinfo os.FileInfo) time.Time { - return timespecToTime(stat_t.Atim) + return timespecToTime(fileinfo.Sys().(*syscall.Stat_t).Atim) }