Since Go 1.25, the default GOMAXPROCS considers a container CPU limit when it is lower than the host core count. The runtime can periodically adapt when that limit changes.
GOMAXPROCS limits parallel Go execution while a CPU quota limits usage over time, so the two are not identical. Explicit environment or API settings override the default behavior.
When to use
Use it when diagnosing container CPU quotas and goroutine parallelism.