Member-only story
The Go Compiler Just Code-Reviewed Me (And It Was Right)
I wrote six functions in 2021-era Go. A bot rewrote them. Then I learned why the Go team built a semantic code reviewer into the compiler.
I need to tell you about the most humbling five minutes of my week.
I wrote a file called legacy.go — six functions, deliberately written in the Go idioms I learned in 2021. interface{} instead of any. Hand-rolled min/max with if/else ladders. Manual map key gathering with for k := range m. The whole pre-1.18 vibe that's still burned into my muscle memory.
Then I ran one command:
go fix -diff ./...And the compiler said: “I’ll take it from here.”
It rewrote my code. Not with regex. Not with search-and-replace. With semantic understanding of what I was actually trying to do. It saw my interface{} and said "that's so 2021" — rewrote it to any. It saw my []byte(fmt.Sprintf(...)) dance and said "we have fmt.Appendf now, friend" — rewrote it to the pre-allocated version.
I wrote none of the new code. The bot is a better Go programmer than I was four years ago.
(This article was co-authored with https://liteagent.cloud/ . Try it today!)











