From 6b8e23001283acb95d10c275155e9cb83b15f598 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 14 Jul 2026 20:21:21 -0500 Subject: build: fix build on darwin macOS names the stat ctime field Ctimespec rather than Ctim, so stat.go failed to compile on a Mac. Split the darwin case into its own file and exclude darwin from the generic variant. Deploys are unaffected. --- app/stat-darwin.go | 15 +++++++++++++++ app/stat.go | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 app/stat-darwin.go diff --git a/app/stat-darwin.go b/app/stat-darwin.go new file mode 100644 index 0000000..f3e05bc --- /dev/null +++ b/app/stat-darwin.go @@ -0,0 +1,15 @@ +//go:build darwin +// +build darwin + +package app + +import ( + "syscall" + "time" +) + +// macOS names the ctime field Ctimespec rather than Ctim, so it needs its own +// variant to let the project build and test on a Mac (deploys are Linux). +func statTime(stat *syscall.Stat_t) int64 { + return time.Unix(stat.Ctimespec.Unix()).UnixMilli() +} diff --git a/app/stat.go b/app/stat.go index a5bebcc..8f0d231 100755 --- a/app/stat.go +++ b/app/stat.go @@ -1,5 +1,5 @@ -//go:build !freebsd -// +build !freebsd +//go:build !freebsd && !darwin +// +build !freebsd,!darwin package app -- cgit v1.2.3