# Go 1 25

> Apply Go 1.25 language features, tooling, standard-library APIs, migrations, and behaviour changes. Load for Go work targeting 1.25 or later when the model's knowledge may predate the 2025-08-12 release.

- Skill: `cedws/go-1-25` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cedws/go-1-25`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cedws/go-1-25/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: cedws (https://skillmd.com/u/cedws)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cedws/go-1-25

---


# Go 1.25

This overview applies when the project's target Go version is at least 1.25.

## Language

Do not introduce new syntax on the basis of Go 1.25; it makes no language changes that affect programs.

## Tools and modules

- **New capability:** `ignore` directives to `go.mod` for generated, vendored, or otherwise excluded directories that package patterns such as `./...` must skip. Remember that ignored directories remain in module zip files.
- **Available capability:** the `work` package pattern when a command should cover every package in the current module or workspace modules.
- `go version -m -json` is available when build information must be consumed programmatically, and `go doc -http` for local browsable documentation.
- `go vet` can catch `sync.WaitGroup.Add` calls made from the wrong place and host/port strings assembled with `fmt.Sprintf`; replace the latter with `net.JoinHostPort` for IPv6 correctness.
- **Unsupported or discouraged:** depend on an automatically added `toolchain` line when the `go` command updates the `go` directive; Go 1.25 no longer adds one.

## Runtime and diagnostics

- **Runtime behaviour:** the runtime choose `GOMAXPROCS` in containers unless the application has a measured reason to override it. On Linux it accounts for cgroup CPU bandwidth limits and periodically tracks changes. A manual `GOMAXPROCS` setting disables these defaults; call `runtime.SetDefaultGOMAXPROCS` to restore them.
- `runtime/trace.FlightRecorder` can retain a bounded in-memory execution trace and snapshot recent activity when a rare event occurs.
- **Available capability:** `GODEBUG=checkfinalizers=1` while diagnosing stalled finalisers or cleanup queues.
- **Experimental option:** the Green Tea collector only with `GOEXPERIMENT=greenteagc`. Treat it as experimental and validate it against representative workloads.

## Standard library

- **Available capability:** `testing/synctest.Test` and `testing/synctest.Wait` for deterministic concurrent tests that benefit from virtual time and explicit quiescence. Do not depend on the earlier experimental API.
- **Modern alternative:** `sync.WaitGroup.Go` for the common pattern of starting and tracking goroutines when no per-goroutine error result is required.
- `net/http.CrossOriginProtection` can reject unsafe cross-origin browser requests when Fetch Metadata or origin checks fit the service's CSRF model. Configure only the required origin or pattern bypasses.
- **Interface support:** `io/fs.ReadLinkFS` when a filesystem exposes symbolic links. This enables symlink-aware behaviour in `archive/tar.Writer.AddFS`, `os.CopyFS`, `os.DirFS`, `os.Root.FS`, and `testing/fstest`.
- **Modern alternative:** `os.Root` operations for filesystem work that must remain beneath a designated directory.
- `reflect.TypeAssert[T]` is the modern alternative to asserting `Value.Interface()` when converting a reflected value to a known Go type.
- **Available capability:** the `crypto/ecdsa` raw key parsing and `Bytes` APIs instead of assembling encodings through `crypto/elliptic` or `math/big`.
- TLS 1.2 SHA-1 signatures are rejected, servers prefer their highest mutually supported protocol version, and malformed peer behaviour is rejected more strictly. `GODEBUG=tlssha1=1` provides temporary compatibility.

## Experimental JSON

- **Experimental or compatibility option:** `GOEXPERIMENT=jsonv2` only for evaluation. Test existing `encoding/json` users for compatibility, and use `encoding/json/v2` or `encoding/json/jsontext` only while accepting that their APIs may change.

## Testing and compatibility

- **Behavioural requirement:** an error immediately before using any accompanying result. Go 1.25 corrected delayed nil checks that could previously let invalid result use appear to succeed.
- `go build -asan` detects leaked C allocations at process exit. `ASAN_OPTIONS=detect_leaks=0` disables that check.
- **Platform requirement:** macOS 12 or later. Treat `windows/arm` as unavailable for forward-looking work because Go 1.25 is its final release.
- `GOAMD64=v3` and higher fuse multiply-add operations, which can alter exact floating-point results. An explicit conversion between multiplication and addition preserves unfused rounding when required.

