BlogsCloudflareGo Static Analysis Tooling

Go Static Analysis Tooling

Go Static Analysis Tooling

1
posts
2016

Cloudflare is developing and utilizing static analysis tools for Go to improve code quality and ensure dependency management. This includes building custom tools to check for vendored dependencies and exploring the capabilities of Go's static analysis libraries like golang.org/x/tools/go/loader.

2016

Building the simplest Go static analysis tool

4/27/2016

This post details the creation of a simple Go static analysis tool, 'vendorcheck', designed to verify that all non-standard library dependencies are vendored. It explains how to use golang.org/x/tools/go/loader to load packages and their dependencies, how to identify standard library packages, and how to check for the presence of '/vendor/' in dependency paths. The post also provides a link to the tool's GitHub repository and recommends using golang.org/x/tools/go/loader over go/importer for static analysis.