After 6 months of development, Go language announced new 1.24 release few days ago on Tuesday.
Go 1.24 now fully supports generic type aliases. Type aliases, a concept introduced in Go 1.9, allows to create a new name for an existing type without creating a new type. Previously, it didn’t support type parameters. But this changed in Go 1.24. See more about generic type aliases.
The feature is enabled by default in Go 1.24, but can be disabled by setting GOEXPERIMENT=noaliastypeparams
; though the aliastypeparams
setting will be removed for next Go 1.25.
Go command in the release now has a new -tool
flag for go get
, allowing to add a tool directive to the current module for named packages. It also added new tests
analyzer for go vet
to report common mistakes in declarations of tests, fuzzers, benchmarks, and examples in test packages
Go 1.24 now includes a new set of mechanisms to facilitate FIPS 140-3 compliance. The Go Cryptographic Module is a set of standard library to implement FIPS 140-3 approved algorithms. And, applications require no changes to use it for approved algorithms.
Benchmarks may now use the faster and less error-prone testing.B.Loop
method to perform benchmark iterations like for b.Loop() { ... }
in place of the typical loop structures involving b.N
like for range b.N
.
There are as well new os.Root
type provides the ability to perform filesystem operations within a specific directory, and new runtime.AddCleanup
finalization mechanism that is more flexible, more efficient, and less error-prone than runtime.SetFinalizer
.
Other changes include go:wasmexport
compiler directive to export functions to the WebAssembly host, as well as:
- Cgo supports new annotations for C functions to improve run time performance.
- Cache
go run
created executables and the new behavior ofgo tool
into Go build cache. - The objdump tool now supports dissassembly on 64-bit LoongArch (GOARCH=loong64), RISC-V (GOARCH=riscv64), and S390X (GOARCH=s390x).
- New weak package provides weak pointers.
- New crypto/mlkem package implements ML-KEM-768 and ML-KEM-1024.
- New crypto/hkdf, crypto/pbkdf2, and crypto/sha3 packages.
- New experimental testing/synctest package provides support for testing concurrent code.
For more about the new Go 1.24, see the official release note.
Get Go 1.24
Go provides official tarballs for Linux, Windows, macOS, and other supported platform in its website via the link below:
For Linux, simply download the tarball, extract to desired location, and add the go bin folder into PATH, then done. Here’s a step by step guide shows how to do the trick for Ubuntu.