# Go 1 24

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

- Skill: `cedws/go-1-24` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cedws/go-1-24`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cedws/go-1-24/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-24

---


# Go 1.24

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

## Language

- **Available capability:** parameterised type aliases when an existing generic type must be re-exported or renamed without creating a distinct defined type.
- **Unsupported or discouraged:** depend on `GOEXPERIMENT=noaliastypeparams`; it is a temporary opt-out and the corresponding experiment switch is removed in Go 1.25.

## Tools and modules

- **Tooling support:** executable dependencies with `tool` directives in `go.mod` instead of blank imports in `tools.go`. Add one with `go get -tool`, run it with `go tool`, and use the `tool` meta-pattern to upgrade or install all tracked tools.
- **Available capability:** `go build -json`, `go install -json`, and `go test -json` when automation needs structured build diagnostics. Update consumers to distinguish build actions interleaved with test actions.
- **Configuration support:** `GOAUTH` for authenticated private-module fetches instead of embedding credentials in repository configuration.
- `GODEBUG=toolchaintrace=1` is available when diagnosing automatic toolchain selection.
- `go vet` can catch malformed tests, non-constant `fmt.Printf(s)` calls without arguments, invalid point-release build tags, and copied locks in three-clause loop variables.
- Apply `#cgo noescape` and `#cgo nocallback` only when the C function's behaviour proves the annotation; incorrect declarations can invalidate compiler assumptions.

## Runtime and resource lifetime

- `runtime.AddCleanup` is the modern alternative to `runtime.SetFinalizer`. Use it for one or more cleanups without delaying reclamation or creating the same cycle-related leaks as finalisers.
- **Available capability:** `weak.Pointer` only for low-level caches, weak maps, or canonicalisation structures that cannot use `unique`; do not use weak reachability as ordinary ownership.
- the Swiss-table map and new runtime mutex is defaults. Use `GOEXPERIMENT=noswissmap` or `nospinbitmutex` only to isolate an upgrade regression.

## Filesystems and encoding

- **Available capability:** `os.OpenRoot` and `os.Root` operations when filesystem access must remain beneath a directory, including across symbolic links.
- **Modern alternative:** iterator-returning `bytes` and `strings` split, field, and line functions when streaming values avoids an intermediate slice.
- **Interface support:** `encoding.TextAppender` or `encoding.BinaryAppender` when a type can append its representation into caller-owned storage and avoid a fresh allocation.
- **Available capability:** the JSON `omitzero` tag when the semantic requirement is to omit a zero value, especially zero `time.Time` values. Keep `omitempty` for JSON-empty semantics.
- **Available capability:** iterator methods in `go/types` rather than `Len` and `At` index loops when traversing exposed sequences.

## Cryptography

- **Available capability:** the standard-library `crypto/mlkem`, `crypto/hkdf`, `crypto/pbkdf2`, and `crypto/sha3` packages instead of their `golang.org/x/crypto` predecessors when Go 1.24 is the minimum target.
- `cipher.NewGCMWithRandomNonce` is available when AES-GCM nonce generation and ciphertext prefixing should be handled by the AEAD. Do not separately supply a nonce to that AEAD.
- **Replacement:** deprecated OFB and CFB modes with authenticated AEAD modes. Use CTR only when an unauthenticated stream mode is explicitly required.
- Reject RSA keys smaller than 1024 bits. Use `GODEBUG=rsa1024min=0` only in a test that must exercise a legacy key.
- `crypto/rand.Text` supports cryptographically secure random text.
- **Available capability:** `crypto/subtle.WithDataIndependentTiming` around code that requires supported architecture-specific data-independent timing.
- X25519MLKEM768 is enabled in TLS defaults, while the earlier experimental X25519Kyber768Draft00 mechanism is unavailable.
- Select a Go Cryptographic Module with `GOFIPS140` and enable FIPS mode with `GODEBUG=fips140=...` only when the deployment's compliance policy requires it.

## Testing

- **Modern alternative:** `for b.Loop() { ... }` in benchmarks so setup runs once and benchmarked calls remain live against compiler elimination.
- **Available capability:** `T.Context` or `B.Context` for work that must be cancelled after the test finishes and before cleanup functions run.
- **Available capability:** `T.Chdir` or `B.Chdir` for a scoped working-directory change in tests.
- `GOEXPERIMENT=synctest` is an experimental opt-in for evaluate deterministic concurrent tests with virtual time and quiescence detection. Treat the Go 1.24 API as unstable.

## Compatibility

- **Replacement:** calls to deprecated `runtime.GOROOT` with locating the `go` executable and invoking `go env GOROOT` when the installation root is needed.
- **Unsupported or discouraged:** call deprecated `math/rand.Seed`; create and seed a local generator when reproducibility is required.
- **Configuration support:** HTTP versions through `http.Server.Protocols`, `http.Transport.Protocols`, and their HTTP/2 settings. Enable unencrypted HTTP/2 only when prior-knowledge h2c is intended.
- **Platform requirement:** Linux kernel 3.2 or later. Treat macOS 11 as the final supported macOS baseline for this release and remove the broken `windows/arm` target.
- **Available capability:** `//go:wasmexport` and `-buildmode=c-shared` only for supported WebAssembly host exports or WASI reactor/library builds.

