Radar · Go · Archive · Week 7 · Feb 10 – 16, 2025
Go 1.24 is released!
Nice to knowecosystem
- What changed
- The blog post summarizes Go 1.24’s new features, including generic type aliases, map performance, and FIPS 140 compliance.
- Production impact
- The source does not say.
- Try it
- Read the blog to learn about the new language features.
- Source
- go.dev/blog/go1.24
Understand it, then run it
Run it now
// This program demonstrates the new generic type alias feature introduced in Go 1.24.
// It defines a generic alias for a map type and uses it to store and retrieve values.
package main
import "fmt"
// Generic type alias: a map from K to V, where K must be comparable.
type MyMap[K comparable, V any] = map[K]V
func main() {
// Create a MyMap[int, string] and populate it.
m := MyMap[int, string]{}
m[1] = "one"
m[2] = "two"
// Print the map contents.
for k, v := range m {
fmt.Printf("%d -> %s\n", k, v)
}
}
What it printed when we ran it on Go 1.27.1
1 -> one 2 -> two
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed