feat: add kernel version reporting for all platforms

This commit is contained in:
JohnsonRan
2025-08-02 22:20:42 +08:00
parent d9d9c4b606
commit a0437e9b7b
5 changed files with 58 additions and 0 deletions

View File

@@ -19,3 +19,14 @@ func OSName() string {
name := strings.TrimSpace(string(output))
return name
}
// KernelVersion returns the kernel version on Darwin (macOS)
func KernelVersion() string {
cmd := exec.Command("uname", "-r")
output, err := cmd.Output()
if err != nil {
return "Unknown"
}
return strings.TrimSpace(string(output))
}