mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
commit
a1bc7cfd6a
@ -41,11 +41,27 @@ func NewSystemInfo() *SystemInfo {
|
|||||||
m[strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1])
|
m[strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
sysInfo := SystemInfo{
|
var sysInfo *SystemInfo
|
||||||
|
switch runtime.GOOS {
|
||||||
|
case "linux":
|
||||||
|
sysInfo = &SystemInfo{
|
||||||
|
ProductName: m["Distributor ID"],
|
||||||
|
ProductVersion: m["Description"],
|
||||||
|
BuildVersion: m["Release"],
|
||||||
|
}
|
||||||
|
case "darwin":
|
||||||
|
sysInfo = &SystemInfo{
|
||||||
|
ProductName: m["ProductName"],
|
||||||
|
ProductVersion: m["ProductVersion"],
|
||||||
|
BuildVersion: m["BuildVersion"],
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
sysInfo = &SystemInfo{
|
||||||
ProductName: m["ProductName"],
|
ProductName: m["ProductName"],
|
||||||
ProductVersion: m["ProductVersion"],
|
ProductVersion: m["ProductVersion"],
|
||||||
BuildVersion: m["BuildVersion"],
|
BuildVersion: m["BuildVersion"],
|
||||||
}
|
}
|
||||||
|
|
||||||
return &sysInfo
|
}
|
||||||
|
return sysInfo
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user