Description
cmd/go
has historically been user-facing.
Recently, we have started to lean on it more as the single source of truth about how the build and package management system works, moving away from package-based APIs like go/build
.
This has caused non-trivial pain. One example: #29452 is about trouble with go list
side-effects. Another example: folks are already moving away from using it in favor of copying and pasting code. There are more.
I wonder whether we should start to address these issues by adding specialized subcommands to cmd/go that aren't necessarily clean or pretty, but that instead are focused on efficiently addressing common tooling needs and that have guaranteed stable output and that have useful properties for tooling like being side-effect-free or network-access-free. The obvious analogy is git's porcelain vs plumbing, although those names are not great.
This is a vague suggestion; it is meant to provoke discussion and perhaps change how we're thinking about this set of problems.