Commit 6b8e230012
Verified · cmc
Layout: unified · split
app/stat-darwin.go added +15
| @@ -0,0 +1,15 @@ | ||
| 1 | //go:build darwin | |
| 2 | // +build darwin | |
| 3 | ||
| 4 | package app | |
| 5 | ||
| 6 | import ( | |
| 7 | "syscall" | |
| 8 | "time" | |
| 9 | ) | |
| 10 | ||
| 11 | // macOS names the ctime field Ctimespec rather than Ctim, so it needs its own | |
| 12 | // variant to let the project build and test on a Mac (deploys are Linux). | |
| 13 | func statTime(stat *syscall.Stat_t) int64 { | |
| 14 | return time.Unix(stat.Ctimespec.Unix()).UnixMilli() | |
| 15 | } | |
app/stat.go +2 −2
| @@ -1,5 +1,5 @@ | ||
| 1 | //go:build !freebsd | |
| 2 | // +build !freebsd | |
| 1 | //go:build !freebsd && !darwin | |
| 2 | // +build !freebsd,!darwin | |
| 3 | 3 | |
| 4 | 4 | package app |
| 5 | 5 | |