秋来冬风的博客

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:

  1. GOMAXPROCS now considers CPU limitations when running on containers, which is very useful when Go programs run on containers such as Kubernetes.
  2. 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.
  3. 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.
  4. 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.
  5. The compiler now uses DWARF version 5 to generate debugging information, which reduces the size of binary files generated during compilation.
  6. The net/http package has added an API to prevent cross site forgery attacks (CSRF).
  7. Set the environment variable GOEXPERIMENT=jsonv2 during construction to experience the v2 version of the JSON package being used.
Tags: