Hacker News Viewer

Go Analysis Framework: modular static analysis by go team

by AbuAssar on 7/26/2026, 12:21:26 PM

https://pkg.go.dev/golang.org/x/tools/go/analysis

Comments

by: b7e7d855b448

You guys can keep complaining about how go is too verbose, but I love everything about go.<p>I love the error handling, I love the forced formatting, i love all the linting it has including style guides. When you read other source code it&#x27;s so easy to understand it and make sense of it. Thank you go team<p>(Ok, maybe I am a bit sceptical with the latest generic additions, but overall it&#x27;s a great language. I love it.)

7/26/2026, 5:07:50 PM


by: jzelinskie

For SpiceDB[0], we&#x27;ve found a lot of success using this framework to define our own analyzers; it&#x27;s probably 10x easier now with LLMs. No need for tribal knowledge or more time wasted on code review if you can just turn it into a linter and move on.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;authzed&#x2F;spicedb&#x2F;tree&#x2F;main&#x2F;tools&#x2F;analyzers" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;authzed&#x2F;spicedb&#x2F;tree&#x2F;main&#x2F;tools&#x2F;analyzers</a>

7/26/2026, 6:02:44 PM


by: jamescun

This isn&#x27;t new?<p>You can see it&#x27;s used by _a lot_ of linters already:<p><a href="https:&#x2F;&#x2F;pkg.go.dev&#x2F;golang.org&#x2F;x&#x2F;tools&#x2F;go&#x2F;analysis?tab=importedby" rel="nofollow">https:&#x2F;&#x2F;pkg.go.dev&#x2F;golang.org&#x2F;x&#x2F;tools&#x2F;go&#x2F;analysis?tab=import...</a>

7/26/2026, 1:52:15 PM


by: ksec

So what is context? This isn&#x27;t new and why the submission ?

7/26/2026, 5:21:05 PM


by: mchav

Can these sorts of primitives be used to create broader &quot;architectural&quot; linters?

7/26/2026, 7:40:57 PM


by: hoppp

I was just looking for this. Will give it a spin.

7/26/2026, 1:19:26 PM


by: verdverm

The Go team&#x27;s emphasis on tooling in the service of software engineering is a boon to human and agentic development alike. Give yourself and your agents great tools.<p>An example from one of my recent projects: <a href="https:&#x2F;&#x2F;github.com&#x2F;verdverm&#x2F;gmd&#x2F;blob&#x2F;main&#x2F;Makefile" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;verdverm&#x2F;gmd&#x2F;blob&#x2F;main&#x2F;Makefile</a> (give agents simple &quot;tool calls&quot; instead of needing to divine the correct args&#x2F;flags every time, essentially invocable agents.md content)<p>One of the interesting things to call out from this is using build tags for testing { unit, coverage, recorded, real api }, with the buffet allowing the agent to iterate faster and more targeted. I tend to run the linting and coverage in a new session, have a report generated, and then another fresh session to start dealing with gaps.<p>Another super cool testing tool in the Go internal source is `testscript`. Roger Peppe extracted a number of those internal utilities here <a href="https:&#x2F;&#x2F;github.com&#x2F;rogpeppe&#x2F;go-internal&#x2F;tree&#x2F;master&#x2F;testscript" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rogpeppe&#x2F;go-internal&#x2F;tree&#x2F;master&#x2F;testscri...</a>

7/26/2026, 6:49:52 PM


by: greatsage_sh

[flagged]

7/27/2026, 1:04:41 AM


by: k9294

[flagged]

7/26/2026, 6:00:57 PM


by: neet_dev

[flagged]

7/26/2026, 11:02:12 PM


by: someworkk

[flagged]

7/26/2026, 3:46:50 PM


by: dfasifsaf

[flagged]

7/26/2026, 2:22:30 PM