This section will talk about finding out information about your current Go environment using the functions and the properties of the runtime package. The name of the program that will be developed in this section is goEnv.go and it will be presented in two parts.
The first part of goEnv.go is next:
package main import ( "fmt" "runtime" )
As you will see in a while, the runtime package contains functions and properties that will reveal the desired information. The second code portion of goEnv.go contains the implementation of the main() function:
func main() { fmt.Print("You are using ", runtime.Compiler, " ") fmt.Println("on a", runtime.GOARCH, "machine") fmt.Println("Using Go version", runtime.Version()) fmt.Println("Number of CPUs:", runtime.NumCPU...