Go Team Unveils Modular Static Analysis Framework for Better Code Checks
Go Analysis Framework: modular static analysis by go team
I explain how the new Go analysis package enables modular static analysis, allowing tools to inspect code one package at a time while sharing insights across dependencies. This framework lets developers build custom checkers that integrate seamlessly into IDEs, build systems, and command-line tools like vet, promoting efficient and scalable code quality checks without reinventing the wheel.
A result such as 'f is a printf wrapper' that is not interesting by itself but serves as a stepping stone to an interesting result is called a Fact.
- b7e7d855b448
You guys can keep complaining about how go is too verbose, but I love everything about go.
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's so easy to understand it and make sense of it. Thank you go team
(Ok, maybe I am a bit sceptical with the latest generic additions, but overall it's a great language. I love it.)
- jzelinskie
For SpiceDB[0], we've found a lot of success using this framework to define our own analyzers; it'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.
[0]: https://github.com/authzed/spicedb/tree/main/tools/analyzers
- jamescun
This isn't new?
You can see it's used by _a lot_ of linters already:
https://pkg.go.dev/golang.org/x/tools/go/analysis?tab=import...
- mchav
Can these sorts of primitives be used to create broader "architectural" linters?
- ksec
So what is context? This isn't new and why the submission ?