Files
insights-go/os_info_darwin.go
T
73785c570c feat: add automatic system context to all events (#167)
* feat: add automatic OS detection to all events

* fixes

* Add android and ios mappings for OS names

* add go_version, os_version and os_distro

* fix: target master branch in CodeQL workflow

---------

Co-authored-by: Manoel Aranda Neto <[email protected]>
2026-03-23 17:40:38 +01:00

22 lines
310 B
Go

//go:build darwin
package posthog
import (
"os/exec"
"strings"
)
func getOSInfo() osInfo {
out, err := exec.Command("sw_vers", "-productVersion").Output()
if err != nil {
return osInfo{
Name: "Mac OS X",
}
}
return osInfo{
Name: "Mac OS X",
Version: strings.TrimSpace(string(out)),
}
}