feat: migrate to golang
This commit is contained in:
18
internal/subscription/ctime_darwin.go
Normal file
18
internal/subscription/ctime_darwin.go
Normal file
@ -0,0 +1,18 @@
|
||||
//go:build darwin
|
||||
|
||||
package subscription
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
// creationTime returns the file's birth time on macOS, matching Python's
|
||||
// stat.st_birthtime (subscription_manager.py:273-275).
|
||||
func creationTime(info os.FileInfo) time.Time {
|
||||
if stat, ok := info.Sys().(*syscall.Stat_t); ok {
|
||||
return time.Unix(stat.Birthtimespec.Sec, stat.Birthtimespec.Nsec)
|
||||
}
|
||||
return info.ModTime()
|
||||
}
|
||||
Reference in New Issue
Block a user