main Package Import ( "FMT" "Runtime" ) // set the running audit golang more versions //1.8 automatically set FUNC main () { // set the number of CPU cores running // NumCPU returns a logical cpu local machine number NUM: = runtime.NumCPU () fmt.Println (NUM) // set the maximum number of CPU can execute concurrently GOMAXPROCS runtime.GOMAXPROCS (NUM) }