此内容没有您所选择的语言版本。

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 go command, the compiler, and the archive/tar, crypto/tls, crypto/x509, html/template, and os packages. It also includes bug fixes to the go command, the go fix command, the compiler, the linker, the runtime, and the net, net/http, and net/url packages.
  • Language:

    • The built-in new function 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.
  • 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.
  • Tools:

    • The go fix command is reimplemented around modernizers that update projects to current idioms and library APIs. Historical go fix fixers were removed.
    • The cmd/doc helper and the go tool doc command are removed. Use go doc with the same flags and arguments.
    • After you run go mod init, new go.mod files default the go directive to the previous supported minor release series (for example, the Go 1.26.2 toolchain defaults new modules to go 1.25). Adjust the directive with go get go@version if you need a different minimum version.
    • The pprof tool web UI, which you enable with the -http flag, defaults to the flame graph view.
  • 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/hpke package 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 the tlssecpmlkem=0 GODEBUG setting where required.
    • The net/url package rejects some malformed URLs that contain misplaced colons in the host portion. The urlstrictcolons=0 GODEBUG setting restores the previous parsing behavior.

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.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部