feat: migrate to golang
This commit is contained in:
19
internal/subscription/ctime_windows.go
Normal file
19
internal/subscription/ctime_windows.go
Normal file
@ -0,0 +1,19 @@
|
||||
//go:build windows
|
||||
|
||||
package subscription
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
// creationTime returns the file's creation time on Windows, matching
|
||||
// Python's stat.st_ctime on Windows (which is creation time on this
|
||||
// platform, per subscription_manager.py:273-278).
|
||||
func creationTime(info os.FileInfo) time.Time {
|
||||
if stat, ok := info.Sys().(*syscall.Win32FileAttributeData); ok {
|
||||
return time.Unix(0, stat.CreationTime.Nanoseconds())
|
||||
}
|
||||
return info.ModTime()
|
||||
}
|
||||
Reference in New Issue
Block a user