Go 1.23
This overview applies when the project's target Go version is at least 1.23.
Language
- Available capability: range-over-function iterators for pull-free sequence APIs whose shape is
func(func() bool),func(func(K) bool), orfunc(func(K, V) bool). Stop producing values when the yield function returns false. GOEXPERIMENT=aliastypeparamsis an experimental opt-in for evaluate generic type aliases within one package. Do not design cross-package APIs around them in Go 1.23.
Tools
- Available capability:
go mod tidy -diffin checks that must report required module-file changes without modifying files. go env -changedcan inspect only environment settings that differ from Go's defaults.go vetcan detect standard-library symbols newer than the effective Go version declared bygo.modor file build constraints.- uploaded toolchain telemetry is opt-in. Use
go telemetry localto retain counters locally orgo telemetry ononly with an explicit project or user decision. - Unsupported or discouraged: add new
//go:linknamereferences to unmarked standard-library internals. Use-checklinkname=0only for debugging or experiments.
Iterators and canonical values
- Define iterator APIs with
iter.Seqoriter.Seq2, and consume them directly withrange. - Modern alternative: the iterator operations in
slicesandmapswhen they avoid intermediate collections. UseCollect,Sorted, ormaps.Collectwhen a materialised result is actually needed. unique.Makeis available when many equal comparable values should share canonical storage and fast handle equality is useful.- Embed
structs.HostLayoutin structures passed to or accessed by pointer from host APIs when host-compatible field layout is required.
Timers and runtime diagnostics
- Rely on unreachable timers and tickers being garbage-collected without calling
Stopsolely for reclamation. - timer channels is unbuffered. After
Timer.StoporTimer.Reset, rely on the guarantee that stale values prepared earlier will not be delivered. Replacelen(t.C)polling with a non-blocking receive. - Available capability:
GODEBUG=asynctimerchan=1only as temporary migration support for code requiring the older buffered timer behaviour. runtime/debug.SetCrashOutputcan direct fatal runtime reports to an automated crash collector.- Available capability: runtime traces during crash investigation; Go 1.23 flushes trace data on uncaught panic and the trace tool recovers useful data from partially broken traces.
Standard library
path/filepath.Localizecan convert a valid slash-separated path safely to the operating system's path form.net.KeepAliveConfigis available when TCP keep-alive timing needs explicit control on dialled or accepted connections.- Inspect cancellation and deadline causes from
net.DNSErrorwitherrors.Is. - Available capability:
http.Request.CookiesNamed,http.ParseCookie, andhttp.ParseSetCookiewhen duplicate cookie names or strict parsing matter. - Account for
ServeContent,ServeFile, andServeFileFSremoving representation headers from error responses. UseGODEBUG=httpservecontentkeepheaders=1only while migrating middleware that depended on the old behaviour. - Available capability:
reflect.Value.SeqorSeq2only afterType.CanSeqorCanSeq2when the dynamic type is not already known. sync.Map.Clearcan empty a concurrent map rather than ranging and deleting entries individually.
TLS compatibility
- 3DES is absent from default cipher suites, while the experimental post-quantum X25519Kyber768Draft00 exchange is enabled by default.
Config.CipherSuitesandConfig.CurvePreferencescan express different interoperability requirements. tls.X509KeyPairandtls.LoadX509KeyPairpopulateCertificate.Leaf.- Migration note: certificates using SHA-1 signatures; Go 1.24 removes the temporary verification escape hatch announced in this release.
Platform compatibility
- Platform requirement: macOS 11 or later.
- Compatibility outlook: Linux deployments for a minimum kernel of 3.2 before moving to Go 1.24.
- Configuration:
GOARM64when binaries require a specific minimum ARM64 architecture or the LSE or cryptographic extensions; otherwise retain the portablev8.0default.