このコンテンツは選択した言語では利用できません。
Chapter 6. Changes in Go Toolset 1.26.2
Go Toolset has been updated to version 1.26.2.
Maintenance release:
-
Go 1.26.2 includes security fixes to the
gocommand, the compiler, and thearchive/tar,crypto/tls,crypto/x509,html/template, andospackages. It also includes bug fixes to thegocommand, thego fixcommand, the compiler, the linker, the runtime, and thenet,net/http, andnet/urlpackages.
-
Go 1.26.2 includes security fixes to the
Language:
-
The built-in
newfunction accepts an expression operand that sets the initial value of the allocated variable. - A generic type can refer to itself in its type parameter list, which allows recursive constraints such as a type that must be instantiated with a type like itself.
-
The built-in
Runtime and performance:
-
The Green Tea garbage collector, which improves marking and scanning of small objects, is enabled by default. If you must opt out at build time, set
GOEXPERIMENT=nogreenteagc. This setting is scheduled for removal in Go 1.27. - Baseline overhead for cgo calls is reduced.
-
On 64-bit platforms, the runtime randomizes the heap base address at process start to harden cgo binaries against exploitation. If you must opt out at build time, set
GOEXPERIMENT=norandomizedheapbase64.
-
The Green Tea garbage collector, which improves marking and scanning of small objects, is enabled by default. If you must opt out at build time, set
Tools:
-
The
go fixcommand is reimplemented around modernizers that update projects to current idioms and library APIs. Historicalgo fixfixers were removed. -
The
cmd/dochelper and thego tool doccommand are removed. Usego docwith the same flags and arguments. -
After you run
go mod init, newgo.modfiles default thegodirective to the previous supported minor release series (for example, the Go 1.26.2 toolchain defaults new modules togo 1.25). Adjust the directive withgo get go@versionif you need a different minimum version. -
The
pproftool web UI, which you enable with the-httpflag, defaults to the flame graph view.
-
The
Compiler:
- The compiler can allocate backing storage for slices on the stack in more situations, which can improve performance.
Standard library (highlights):
-
The new
crypto/hpkepackage implements Hybrid Public Key Encryption (HPKE) per RFC 9180, including post-quantum hybrid KEMs. -
Post-quantum hybrid TLS key exchanges are enabled by default in
crypto/tls. You can adjust curve preferences or use thetlssecpmlkem=0GODEBUGsetting where required. -
The
net/urlpackage rejects some malformed URLs that contain misplaced colons in the host portion. Theurlstrictcolons=0GODEBUGsetting restores the previous parsing behavior.
-
The new
For maintenance details in Go 1.26.2, see the Go release history and the Go 1.26.2 milestone. For Go 1.26 feature changes, see the upstream Go 1.26 release notes.
Go Toolset is a rolling Application Stream, and Red Hat supports only the latest version. For more information, see the Red Hat Enterprise Linux Application Streams Life Cycle document.