HEAPS

Go 1.25: container aware GOMAXPROCS, synctest, and what to enable

Go 1.25 understands Kubernetes CPU limits better, stabilizes testing/synctest, and experiments with json/v2 plus a new GC.

Go 1.25 does not rewrite the language. It changes production behavior.

The August 2025 release follows the usual Go path: compatibility stays, and most of the value sits in the runtime, toolchain, and standard library. If you run Go in Kubernetes or write concurrent tests, you will feel these changes sooner than a changelog skim suggests.

Container aware GOMAXPROCS

Older Go defaults used the host’s logical CPU count. A pod limited to 2 CPUs on a 32 core node could schedule poorly and burn more than expected.

In 1.25 the runtime reads cgroup limits and adjusts GOMAXPROCS. Fewer surprises under horizontal pod autoscaling, less hand rolled env config in every Deployment. You can still override it when you are measuring something unusual.

testing/synctest is no longer an experiment

The concurrency testing package graduated. If you have been papering over flake with time.Sleep “just in case”, synctest gives a controlled bubble without waiting on a real clock.

func TestWorker(t *testing.T) {
    synctest.Test(t, func(t *testing.T) {
        // goroutines and channels
        // without random sleeps “so it finishes”
    })
}

For services with workers, fan out, and timeouts, that saves real CI hours.

Experiments: json/v2 and Green Tea GC

Go 1.25 keeps both behind GOEXPERIMENT, so do not flip them on in production on day one.

GOEXPERIMENT=jsonv2 brings a newer JSON stack with better throughput and more predictable marshaling. Try it on staging for services that live on large payloads.

GOEXPERIMENT=greenteagc targets GC pressure from lots of small objects. If you cache many small structs, measure p50/p99 pause time before and after.

Tooling and binaries

DWARF 5 shrinks debug info and speeds linking on large binaries. go build -asan defaults to leak detection for C allocations, which can annoy cgo setups but catches real bugs earlier. Pure Go services usually will not notice.

Should you move from 1.24

Yes, if:

  • you deploy into containers with CPU limits,
  • concurrent tests flake in CI,
  • you want faster toolchain feedback on a large repo.

Wait on the JSON and GC experiments until you have numbers from your own traffic. The bump from 1.24 to 1.25 is often calm because the language barely moved, while the runtime understands containers better.