Go1.25 is worth paying attention to
目录
Software translation
The development cycle of go1.25 has entered a release freeze, and generally there will be no new features. Currently, the author believes that the following are worth paying attention to:
- GOMAXPROCS now considers CPU limitations when running on containers, which is very useful when Go programs run on containers such as Kubernetes.
- There is now a new garbage collector as an experiment, which sets the environment variable GOEXPERIMENT=greenteagc to be enabled during construction, which improves performance in certain scenarios.
- Now for the value recovered after the panic, the value will not be printed repeatedly, which avoids the final output of the panic including duplicate content during testing.
- The experimental package testing/synctest has been completed and turned positive. Like other standard library packages, it guarantees backward compatibility according to the go1 compatibility commitment, providing support for testing concurrent code.
- The compiler now uses DWARF version 5 to generate debugging information, which reduces the size of binary files generated during compilation.
- The net/http package has added an API to prevent cross site forgery attacks (CSRF).
- Set the environment variable GOEXPERIMENT=jsonv2 during construction to experience the v2 version of the JSON package being used.