mirror of
https://github.com/hanzoai/insights-go.git
synced 2026-09-30 22:46:12 +00:00
* 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]>
22 lines
310 B
Go
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)),
|
|
}
|
|
}
|