Go release 1.23

Changes to the language

The 'for-range' loop now accepts iterator functions, enabling iteration over custom data structures and sequences.

**Important:** Developers should familiarize themselves with the new iterator functions in the 'iter' package and how to use them in 'for-range' loops.

Go 1.23 introduces preview support for generic type aliases, but only within the same package.

Tools

Go 1.23 introduces telemetry to collect usage and breakage statistics.

**Important:** Telemetry is opt-in. Run 'go telemetry on' to enable it and help the Go team improve the language.

The 'go mod tidy -diff' command now shows a diff of necessary changes without modifying files.

The 'go vet' command includes the 'stdversion' analyzer to flag references to symbols too new for the Go version in use.

The 'cmd/cgo' command supports the '-ldflags' flag for passing flags to the C linker.

Runtime

The traceback printed after an unhandled panic now indents error message lines for better readability.

Compiler

The compiler's Profile Guided Optimization (PGO) build time overhead is significantly reduced.

The compiler can now overlap stack frame slots for local variables, reducing stack usage.

Linker

**Important:** The linker now restricts using '//go:linkname' to refer to unmarked internal symbols in the standard library.

The '-bindnow' linker flag enables immediate function binding for dynamically linked ELF binaries.

Standard library

**Important:** Unused 'time.Timer' and 'time.Ticker' instances are now garbage collected immediately, even if 'Stop' is not called.

**Important:** Timer and Ticker channels are now unbuffered, guaranteeing no stale values after 'Reset' or 'Stop'.

The new 'unique' package provides facilities for canonicalizing values, reducing memory footprint by deduplication.

The 'iter' package provides basic definitions for working with user-defined iterators.

The 'slices' and 'maps' packages add several functions that work with iterators.

The new 'structs' package provides types for struct fields that modify properties of the containing struct type.

Ports

Go 1.23 requires macOS 11 Big Sur or later.

**Important:** Go 1.23 is the last release supporting Linux kernel 2.6.32. Go 1.24 will require Linux kernel 3.17 or later.

Experimental support added for OpenBSD on 64-bit RISC-V.

New 'GOARM64' environment variable specifies the minimum target version of the ARM64 architecture.

New 'GORISCV64' environment variable selects the RISC-V user-mode application profile.