toolsgolang.org/x/tools/go/packages/internal/nodecount

nodecount command

The nodecount program illustrates the use of packages.Load to print the frequency of occurrence of each type of syntax node among the selected packages.

Example usage:

$ nodecount golang.org/x/tools/... std

A typical distribution is 40% identifiers, 10% literals, 8% selectors, and 6% calls; around 3% each of BinaryExpr, BlockStmt, AssignStmt, Field, and Comment; and the rest accounting for 20%.

Version
v0.30.0 (latest)
Published
Feb 10, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
6 hours ago

Tools for package owners.