1.26rc1

Latest release in branch 1.26
Released 27 days ago (December 16, 2025)

Software Go
Branch 1.26
Status
RC
Release notes https://go.dev/doc/go1.26
Documentation https://go.dev/doc/
Go 1.26 Releases View full list

What is new in Go 1.26

Go 1.26 introduces a range of performance improvements, new runtime features, and useful updates across the toolchain and standard library. The biggest changes focus on making programs run faster with less overhead, especially around garbage collection, memory allocation, and cgo calls.

Developers will also find better debugging tools, a small but handy language tweak, new cryptographic packages, and many small enhancements that make everyday coding smoother and more secure.

Overall, this release continues Go's focus on reliability, speed, and modern hardware support while keeping the language stable and backward-compatible.

Changes to the Language

The built-in new function now accepts any expression as its argument, not just a type name. This makes it easier to initialize pointers directly in one expression, which is particularly helpful when setting optional fields in structs for serialization formats like JSON or protocol buffers.

Here is a practical example:

type Person struct {
    Name string   `json:"name"`
    Age  *int     `json:"age"`
}

func personJSON(name string, born time.Time) ([]byte, error) {
    return json.Marshal(Person{
        Name: name,
        Age:  new(yearsSince(born)),
    })
}

Tools

Go Command

  • The separate cmd/doc package and go tool doc command have been removed. Use go doc instead, which supports the same flags and behavior.
  • The go fix command now uses the modern Go analysis framework (the same one used by go vet). Older built-in fixers have been replaced with new analyzers that handle updates for recent language and library features.

Pprof

When starting the pprof web UI with the -http flag, it now opens directly to the flame graph view by default. The classic graph view is still available through the "View -> Graph" menu or by visiting /ui/graph.

Runtime

Garbage Collector

The Green Tea garbage collector, which was experimental in Go 1.25, is now enabled by default. It offers better locality and CPU scaling when marking and scanning small objects. Most programs with heavy GC workloads should see 10 to 40 percent lower GC overhead. On newer AMD64 CPUs (Intel Ice Lake and later, AMD Zen 4 and later), vector instructions provide an additional roughly 10 percent improvement.

You can disable it at build time with GOEXPERIMENT=nogreenteagc if needed (this option will be removed in Go 1.27).

Faster cgo Calls

The baseline overhead for cgo calls has been reduced by about 30 percent.

Faster Memory Allocation

The compiler now generates calls to size-specialized allocation routines for small objects (under 512 bytes). This can make small allocations up to 30 percent faster, leading to around 1 percent overall improvement in allocation-heavy programs.

Disable this optimization at build time with GOEXPERIMENT=nosizespecializedmalloc if necessary.

Goroutine Leak Profiles

A new experimental profile type called goroutineleak is available in runtime/pprof. Enable it at build time with GOEXPERIMENT=goroutineleakprofile. It is also exposed via the HTTP debug endpoint at /debug/pprof/goroutineleak.

This profile helps detect goroutines that are blocked on channels, mutexes, or condition variables and are no longer reachable from runnable goroutines, making it easier to find common leak patterns.

There is no runtime cost unless the feature is enabled. The implementation is considered production-ready, and the plan is to enable it by default in Go 1.27.

Compiler

The compiler now places slice backing stores on the stack in more situations, which improves performance. If this causes issues, you can use the bisect tool with -compile=variablemake to identify the problematic allocations, or disable the new behavior with -gcflags=all=-d=variablemakehash=n.

Linker

On Windows/ARM64, the linker now supports internal linking mode for cgo programs when using -ldflags=-linkmode=internal.

Several minor internal changes have been made to executable layout (no effect on runtime behavior), including moving structures to new sections, correcting sizes, and reorganizing debug information.

Bootstrap

Building Go 1.26 now requires at least Go 1.24.6 as the bootstrap compiler.

Standard Library

New Packages

  • crypto/hpke - Implements Hybrid Public Key Encryption (HPKE) as defined in RFC 9180, including support for post-quantum hybrid key encapsulation mechanisms.
  • simd/archsimd (experimental, behind GOEXPERIMENT=simd) - Provides low-level architecture-specific SIMD operations, currently for AMD64 with 128/256/512-bit vectors.
  • runtime/secret (experimental, behind GOEXPERIMENT=runtimesecret) - Helps protect cryptographic temporaries by erasing registers, stack, and heap memory after use. Currently supports AMD64 and ARM64 on Linux.

Notable Minor Changes

  • bytes.Buffer.Peek(n) now returns the next n bytes without advancing the read position.
  • io.ReadAll uses less memory and returns a smaller slice where possible, making it roughly twice as fast with about 50 percent fewer allocations.
  • log/slog.NewMultiHandler creates a handler that forwards to multiple handlers and optimizes enabling checks.
  • net.Dialer adds convenient methods like DialIP, DialTCP, DialUDP, and DialUnix for specific network types.
  • net/http.ReverseProxy deprecates Director in favor of the safer Rewrite hook.
  • net/url.Parse now rejects malformed URLs with extra colons in the host part (except for valid bracketed IPv6 addresses).
  • reflect adds iterator methods for fields, methods, inputs, and outputs.
  • testing adds T.ArtifactDir, B.ArtifactDir, and F.ArtifactDir for storing test artifacts.
  • Cryptography packages have many updates for better randomness handling, new interfaces for key encapsulation, and post-quantum key exchange support in crypto/tls (enabled by default).

Several older GODEBUG settings related to TLS and cryptography are scheduled for removal or default change in Go 1.27.

Releases In Branch 1.26

Version Release date
1.26rc1 27 days ago
(December 16, 2025)