diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-11 19:23:57 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-11 19:23:57 +0800 |
| commit | ad0e841fe94247ba5fc447bc38f779a2c46b2abc (patch) | |
| tree | e179afd1060714cd8c36549a76592b82931ad650 /statistics.go | |
| parent | a461fdfd9b010dafbdf422002c7549cb21023fc4 (diff) | |
fix: extra string in printRecentActivity()
Diffstat (limited to 'statistics.go')
| -rw-r--r-- | statistics.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/statistics.go b/statistics.go index 428d19c..c83a25f 100644 --- a/statistics.go +++ b/statistics.go @@ -58,13 +58,15 @@ func UnifyInfo(formula *FormulaInfo, cask *CaskInfo, pkgName string) (*statistic // === general === // // get system atime + var atime time.Time binPath := filepath.Join("/opt/homebrew/bin", pkgName) info, err := os.Stat(binPath) if err != nil { - return nil // skip if no binary is found + atime = time.Time{} // skip if no binary is found + } else { + atime = time.Unix(info.Sys().(*syscall.Stat_t).Atimespec.Unix()) } - atime := info.Sys().(*syscall.Stat_t).Atimespec - statObject.LastAccessTime = time.Unix(atime.Unix()) + statObject.LastAccessTime = atime return &statObject } |
