Google released a new update for Go language

Go is a statically typed, compiled high-level programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency.

According to the latest report, Go language received a new update with the build number 1.20. The latest update included so many new changes and it will soon cancel support for the old versions of Microsoft Windows and Apple macOS systems. You can check the complete changelog which is mentioned below.

Go 1.20 Release Notes:

Language changes

  • The predeclared comparable constraint is now also satisfied by ordinary comparable types, such as interfaces, which will simplify generic code.
  • The functions SliceDataString, and StringData have been added to package unsafe. They complete the set of functions for implementation-independent slice and string manipulation.
  • Go’s type conversion rules have been extended to permit direct conversion from a slice to an array.
  • The language specification now defines the exact order in which array elements and struct fields are compared. This clarifies what happens in case of panics during comparisons.

Tool improvements

  • The cover tool now can collect coverage profiles of whole programs, not just of unit tests.
  • The go tool no longer relies on pre-compiled standard library package archives in the $GOROOT/pkg directory, and they are no longer shipped with the distribution, resulting in smaller downloads. Instead, packages in the standard library are built as needed and cached in the build cache, like other packages.
  • The implementation of go test -json has been improved to make it more robust in the presence of stray writes to stdout.
  • The go buildgo install, and other build-related commands now accept a -pgo flag enabling profile-guided optimizations as well as a -cover flag for whole-program coverage analysis.
  • The go command now disables cgo by default on systems without a C toolchain. Consequently, when Go is installed on a system without a C compiler, it will now use pure Go builds for packages in the standard library that optionally use cgo, instead of using pre-distributed package archives (which have been removed, as noted above).
  • The vet tool reports more loop variable reference mistakes that may occur in tests running in parallel.

Standard library additions

  • The new crypto/ecdh package provides explicit support for Elliptic Curve Diffie-Hellman key exchanges over NIST curves and Curve25519.
  • The new function errors.Join returns an error wrapping a list of errors which may be obtained again if the error type implements the Unwrap() []error method.
  • The new http.ResponseController type provides access to extended per-request functionality not handled by the http.ResponseWriter interface.
  • The httputil.ReverseProxy forwarding proxy includes a new Rewrite hook function, superseding the previous Director hook.
  • The new context.WithCancelCause function provides a way to cancel a context with a given error. That error can be retrieved by calling the new context.Cause function.
  • The new os/exec.Cmd fields Cancel and WaitDelay specify the behavior of the Cmd when its associated Context is canceled or its process exits.

Improved performance

  • Compiler and garbage collector improvements have reduced memory overhead and improved overall CPU performance by up to 2%.
  • Work specifically targeting compilation times led to build improvements by up to 10%. This brings build speeds back in line with Go 1.17.

Leave a Comment