27 lines
365 B
Go
Raw Permalink Normal View History

2024-12-27 15:56:59 +08:00
package core
import "runtime"
func GetOS() OS {
return OS{
Arch: runtime.GOARCH,
System: OsNameMap[runtime.GOOS],
}
}
var OsNameMap = map[string]string{
"darwin": "macos",
"linux": "linux",
"windows": "windows",
}
type OS struct {
Version string
Arch string
System string
}
func (o *OS) String() string {
return o.System + "-" + o.Arch
}