Go 1.26

Go 1.26

After six months of development, version 1.26 of the compiler and the standard library of the programming language has been released. Go.

Key Changes:

  • The new built-in function that creates a new variable allows using an expression as an operand, specifying the initial value of the variable. A simple example of such a change is code like this:
    x := int64(300) ptr := &x
    This can be simplified to:
    ptr := new(int64(300))
  • Generic types can reference themselves in their own list of type parameters. This change simplifies the implementation of complex data structures and interfaces.

Performance enhancements:

  • The experimental garbage collector Green Tea is now enabled by default.
  • Overhead for CGO has been reduced by approximately 30%.
  • The compiler can now allocate spare memory for Slice structures on the stack in more situations, which improves performance.

Toolkit:

  • The go fix command has been completely rewritten using the analysis framework and now includes several dozen 'modernizers' that offer safe fixes to help your code take advantage of the new features of the language and the standard library.

Experimental additions have been added, available only when explicitly enabled:

  • The package archsimd for accessing architecture-dependent SIMD operations. Currently, only AMD64 is supported.
  • The package secret with auxiliary functions for zeroing memory.
  • In the profiling package, pprof support for the GOEXPERIMENT=goroutineleakprofile option has been added to detect goroutine leaks.

>>> Complete list of changes

Source: linux.org.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster