Go CLI
$ go Official Low RiskThe official Go command-line toolchain covering builds, modules, vetting, formatting, and testing. Features built-in go list -json, streaming go test -json event logs, and go build -n dry-run command printing with fast compilation.
brew install go Executes local compilation, go vet, and go test -json directly on Go packages with sub-second caching.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
Go is a tool for managing Go source code. Usage: go <command> [arguments] The commands are: bug start a bug report build compile packages and dependencies clean remove object files and cached files doc show documentation for package or symbol env print Go environment information fix apply fixes suggested by static checkers fmt gofmt (reformat) package sources generate generate Go files by processing source get add dependencies to current module and install them install compile and install packages and dependencies list list packages or modules mod module maintenance work workspace maintenance run compile and run Go program telemetry manage telemetry data and settings test test packages tool run specified go tool version print Go version vet report likely mistakes in packages Use "go help <command>" for more information about a command. Additional help topics: buildconstraint build constraints buildjson build -json encoding buildmode build modes c calling between Go and C cache build and test caching environment environment variables filetype file types goauth GOAUTH environment variable go.mod the go.mod file gopath GOPATH environment variable goproxy module proxy protocol importpath import path syntax modules modules, module versions, and more module-auth module authentication using go.sum packages package lists and patterns private configuration for downloading non-public code testflag testing flags testfunc testing functions vcs controlling version control with GOVCS Use "go help <topic>" for more information about that topic.
FCRS-1.0 6-Dimension Breakdown
Built-in go list -json, go test -json, go version -m, go build -n, and zero interactive prompts across the entire CLI.
go test -jsonstreams structured per-test JSON eventsgo list -jsonoutputs complete package and module JSON
Deterministic module checksums (go.sum), build -n dry-run, and zero remote publishing side effects.
- Cryptographic
go.sumverification and-ndry-run mode
Self-contained toolchain archive or Homebrew/system package across macOS, Linux, and Windows.
- Single toolchain archive with cross-compilation built in
Fast incremental compiler, built-in gofmt, go vet, race detector, and test runner in one binary.
- Unified build, test, vet, and module tooling
Official Go Authors toolchain backed by Google under BSD-3-Clause with strict Go 1 compatibility guarantee.
- First-party
golang/gotoolchain
Authoritative reference at pkg.go.dev/cmd/go and built-in go help <topic>.
- Complete command documentation via
go helpand pkg.go.dev
Security, Auth & Guardrails
Public module resolution needs no auth; private modules read ~/.netrc or git credentials configured alongside GOPRIVATE.
BSD-3-Clause open-source toolchain; completely free.
# Go CLI (go) Agent Rules - Prefer `go test -json ./...` and `go vet ./...` for structured verification. - Use `go list -json ./...` instead of parsing `go.mod` or directory trees manually.
Agent-Ready Command Recipes
Safe Read-Only Queries
go list -json ./...
Emits JSON package descriptors (imports, files, module info) without building binaries.
go build -n ./...
Prints the exact compiler and linker invocations without executing them.
Controlled Writes & Previews
go test -json ./...
Runs package tests and streams per-test pass/fail/output JSON events.
Strengths for Agents
- +
go test -jsonandgo list -jsonprovide first-class structured output out of the box. - + Fast incremental build cache and built-in
go vet/-raceverification. - + Zero interactive prompts and strict Go 1 backwards compatibility.
Caveats & Pitfalls
- !
go buildcompiler errors are plain text lines rather than JSON (thoughgo test -jsoncaptures test output). - ! Cross-compiling cgo packages requires target C cross-compilers.