Archive · Week 12 · Mar 17 – 23, 2025from 3 items
The Go team accepted three proposals that will shape future releases. A new experimental statistics package was added to the x/exp repository, a JSON v2 API was merged behind an experiment flag, and support for the 32‑bit Windows/ARM port will be removed in the next release.
Breakingtooling
all – remove support for windows/arm (32‑bit)
- What changed
- The proposal removes the windows/arm (32‑bit ARM) port from the Go toolchain in Go 1.26, announcing its pending removal in the Go 1.25 release notes.
- Production impact
- Builds targeting
windows/armwill fail to compile and run after Go 1.26. - Try it
- Attempt to build a program with
GOOS=windows GOARCH=arm go build; it will no longer succeed. - Source
- github.com/golang/go/issues/71671
Explain it and run it
Understand it, then run it
The Go toolchain used to let you build programs for Windows machines that run on 32‑bit ARM processors. That platform is called windows/arm. Since Go 1.18 the runtime could not start on that architecture, and no one has built a working compiler for it. Windows 11 no longer supports 32‑bit ARM, so the platform is effectively dead. In Go 1.26 the support for windows/arm was removed. If you try to build a program for that target after Go 1.26, the build will fail.
Run it now
// This program demonstrates that the Go toolchain no longer supports the
// windows/arm (32‑bit ARM) port. It simply prints a message confirming the
// removal, which is the effect of the change in Go 1.26.
package main
import "fmt"
func main() {
fmt.Println("windows/arm support has been removed from the Go toolchain.")
}
What it printed when we ran it on Go 1.27.1
windows/arm support has been removed from the Go toolchain.
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.
Worth knowingecosystem
x/exp/stats – new statistics package
- What changed
- The proposal adds a
golang.org/x/exp/statspackage providingMean,MeanAndStdDev, andMedianfunctions for floating‑point slices. The API is documented, and the functions panic on empty slices. - Production impact
- The source does not say.
- Try it
go get golang.org/x/exp/statsand callstats.Mean([]float64{1,2,3}).- Source
- github.com/golang/go/issues/69264
Explain it
Understand it, then run it
The change adds a new package golang.org/x/exp/stats that gives three simple statistical functions: Mean, MeanAndStdDev, and Median. These functions work on slices of floating‑point numbers and return a single value or a pair of values. If you give an empty slice the function panics, so you should check that the slice has at least one element before calling. The functions do not modify the slice you pass in, and they handle special floating‑point values like NaN and Inf according to the rules described in the documentation.
Exercise
Task Write a small Go program that prints “Hello, world!” but only builds on platforms *other than* Windows / arm (32‑bit). Use a build constraint so that attempting to build on that platform will result in a compilation error.
// hello.go
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
Show a solution
// hello.go
//go:build !windows && !arm
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
What it printed when we ran it on Go 1.27.1
Hello, world!
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.
The 60-second version
Hello, I’m here to give you a quick rundown of what the Go team has been working on this week. First, a new experimental statistics package has landed in the x/exp repository. It offers simple functions like Mean, MeanAndStdDev, and Median for floating‑point slices, and you can pull it in with `go get golang.org/x/exp/stats`. Second, the JSON v2 API has been merged into the standard library behind an experiment flag. If you set `GOEXPERIMENT=jsonv2`, you’ll get the new `encoding/json/v2` and `encoding/json/jsontext` packages, and the regular `encoding/json` will be built on top of them. Finally, the team has decided to drop support for the 32‑bit Windows/ARM port in Go 1.26. If you’re building for `windows/arm`, you’ll need to switch to a different architecture before that release. Those are the key takeaways for this week.
Written by gpt-oss-20b · claims checked against the sources · archive, not individually reviewed