modified PlatformVersion and PlatformFamily string to (somewhat) match the output from sysinfo

pull/60/head
mayowa 10 years ago
parent 6fa0704dbf
commit bf16d0a6a7

@ -4,6 +4,7 @@ package host
import ( import (
"os" "os"
"fmt"
"time" "time"
"runtime" "runtime"
"strings" "strings"
@ -23,6 +24,7 @@ type Win32_OperatingSystem struct {
Version string Version string
Caption string Caption string
ProductType uint32 ProductType uint32
BuildNumber string
LastBootUpTime time.Time LastBootUpTime time.Time
} }
@ -100,15 +102,15 @@ func GetPlatformInformation() (platform string, family string, version string, e
// PlatformFamily // PlatformFamily
switch osInfo.ProductType { switch osInfo.ProductType {
case 1: case 1:
family = "Desktop OS" family = "Standalone Workstation"
case 2: case 2:
family = "Server OS (Domain Controller)" family = "Server (Domain Controller)"
case 3: case 3:
family = "Server OS" family = "Server"
} }
// Platform Version // Platform Version
version = osInfo.Version version = fmt.Sprintf("%s Build %s", osInfo.Version, osInfo.BuildNumber)
return return
} }

Loading…
Cancel
Save