Radar · Go · Archive · Week 32 · Aug 4 – 10, 2025
cmd/fix: make all current fixes no‑ops except buildtag
Worth knowingtooling
- What changed
- The Go team made all existing
go fixfixes no‑ops except forbuildtag. The functionality of the formercontextfix will now be provided via//go:fix inlineannotations ingolang.org/x/net/context. - Production impact
- The source does not say.
- Try it
- Run
go fix -fix=cftypeon a small program and observe that nothing changes. - Source
- github.com/golang/go/issues/73605
Understand it, then run it
go fix used to automatically update code when the language changed. The change removes every automatic update except the one that cleans up old +build tags. Instead of running a fix that rewrites imports from golang.org/x/net/context to the standard context, that logic is now embedded in the library itself as a comment directive //go:fix inline. So, if you run go fix today, it will do nothing for those old fixes; only the build‑tag cleanup still runs.
Run it now
// This program demonstrates the current state of `go fix`.
// The legacy context migration is no longer performed by `go fix`
// and must be provided via `//go:fix inline` annotations in the
// golang.org/x/net/context package. The only active fix is
// the build‑tag cleanup, which is not shown here because it
// operates on source files, not at runtime.
package main
import "fmt"
func main() {
fmt.Println("go fix no longer performs context migration.")
}
What it printed when we ran it on Go 1.27.1
go fix no longer performs context migration.
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