Is it guaranteed that GOMAXPROCS is set to 1 when the environment variable of the same name is not set?
This code shows the value:
package main
import (
"runtime"
"fmt"
)
func getGOMAXPROCS() int {
return runtime.GOMAXPROCS(0)
}
func main() {
fmt.Printf("GOMAXPROCS is %d\n", getGOMAXPROCS())
}
and running it like this:
$ GOMAXPROCS= go run max.go
GOMAXPROCS is 1
shows that it is 1 in this case, but I am looking for some confirmation here.