March 7, 2026

PBX Science

VoIP & PBX, Networking, DIY, Computers.

Google releases version 1.21 of programming language Go

Google releases version 1.21 of programming language Go

 

Google releases version 1.21 of programming language Go and cancels support for older versions of Microsoft Windows and Apple macOS systems.

 

 On  Aug 10, Google released a new version 1.21 for the programming language Go.

 Most of the changes in this version focus on the implementation of tool chains, runtimes and libraries. 

Remove support for older versions of Microsoft Windows and Apple macOS systems .

 

▲ Google programming language Go 1.21 release log

 

 

The main updates of Go 1.21 attached to IT Home are as follows:

Improved toolchain

The Profile Guided Optimization (PGO) feature has officially entered the stable phase (GA).

The Enable Profile-Guided Optimization (PGO) feature, which was in preview in 1.20, has now officially entered the stable stage. The principle of PGO is that “the compiler uses the runtime profiling information of the program, so it can generate higher-quality performance”. If a file named default.pgo exists in the main package directory   , the go command will use that default.pgo file to enable PGO builds.

 

Language change

Add new built-in functions:

min, max, clear

Several improvements have been made to type inference for generic functions, including the description of type inference in the “Extended and Clarified Specification”.

In future versions, the development team plans to solve the most common “loop variable capture” problem in Go programming. The development team has provided a “preview” solution in Go 1.21. Currently, users can use “environment variables” in the code Enable this feature.

 

Add new standard library

  • log / slog package: for structured logging;

  • slices package: added for common operations on slices of any element type, this package is faster and more ergonomic than the sort package;

  • maps package: used to perform common operations on any type of key-value;

  • cmp package: for comparing ordered values.

 

Optimize performance

The Go compiler itself has been rebuilt on PGO in 1.21, so the current speed of building Go programs has increased by 2-4%, but the official said that the specific optimization efficiency will depend on the host architecture.

 

Support for WASI

Go 1.21 has experimental support for the WebAssembly System Interface (WASI), Preview 1.

To facilitate writing more general WebAssembly (WASM) code, the compiler also supports a new directive to import functions from the WASM host:

 go:wasmimport






PBXscience.com © All Copyrights Reserved. | Newsphere by AF themes.