goInfo
goInfo copied to clipboard
get os information use golang
When `osStr` is empty or too short (because it's an unreliable external input from running `uname`), the `strings.Split(osStr, " ")` results in an empty list. When trying to use that...
GetInfo returns 2 values.
This PR adds support for storing runtime.GOARCH into the existing struct, as it could be important to retrieve the architecture too.
You can get the information and remove the hardcoded "unknown" in this way: ``` arch := os.Getenv("PROCESSOR_ARCHITECTURE") gio := &GoInfoObject{Kernel:"windows",Core:ver,Platform:arch,OS:"windows",GoOS:runtime.GOOS,CPUs:runtime.NumCPU()} ```