CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

golang/go

Scanned commit 12c76d447f dated 2026-09-22 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/golang/go ↗ · 3995 files · 12.1 MB · scan capped

The Go Programming Language Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Deep analysis by swe-2 via the devin CLI on 2026-09-22 (runtime not recorded) — every claim below links to its cited source files.

Overview

This is the golang/go repository — the complete source of the Go programming language toolchain. It contains the standard library and runtime under src/, the cmd/ suite of tools (go command, compiler, linker, assembler, cgo, vet, gofmt, pprof, trace, and the cmd/dist bootstrap/test orchestrator), a ~2000-file black-box regression corpus under test/, frozen public-API manifests under api/, and per-release notes under doc/. The system is self-hosting: building requires an existing Go toolchain (GOROOT_BOOTSTRAP >= Go 1.26.0), which first compiles cmd/dist, and dist then bootstraps toolchain1 (asm/cgo/compile/link) and a go_bootstrap binary that rebuilds everything else.

System map

The repo is the entire Go distribution: src/ holds the standard library (module 'std'), the runtime, and all toolchain commands under src/cmd/ (module 'cmd'). The build is bootstrapped: src/make.bash compiles src/cmd/dist with a pre-existing Go (GOROOT_BOOTSTRAP), then 'dist bootstrap' builds the compiler/linker/asm and a go_bootstrap binary which rebuilds the full tree. The go command (src/cmd/go) is the user-facing front end dispatching to ~20 subcommands; compilation flows through cmd/compile (frontend+SSA backend) and cmd/link. Tests are orchestrated by 'go tool dist test' (src/cmd/dist/test.go) plus the cmd/internal/testdir harness for the test/ corpus. API stability is enforced by golden manifests in api/ checked by src/cmd/api tests.

All 14 system map claims →

Feature catalog

User-facing surface is dominated by the 'go' command: build/install/run/test/list/doc/env/clean/fmt/fix/generate/get/mod/vet/version/work/tool/telemetry/bug plus ~18 help topics. Inside that, the big subsystems are the module system (modload/modfetch/mvs/vcs), the parallel action-graph build engine with content-hash caching (work.Builder), cgo/SWIG foreign-function builds, coverage instrumentation, PGO, FIPS-140 crypto mode, toolchain auto-switching, and opt-in telemetry. Separate binaries ship gofmt, vet, pprof, trace, cover, covdata, test2json, asm, link, compile, cgo, nm, objdump, pack, addr2line, buildid, dist, distpack, preprofile, relnote.

All 14 feature catalog claims →

Data flow

End-to-end: user args → cmd/go/main → toolchain.Select (may re-exec a downloaded toolchain) → load.Package resolution via go.mod/go.work → modload computes the build list with MVS, fetching modules through modfetch (GOPROXY → zip → sumdb/go.sum verify → modcache) or vcs direct → work.Builder builds an action DAG (compile/cgo/cover/vet/link actions) keyed by sha256 action IDs against the build cache → cmd/compile turns source through noder/typecheck/inline/escape/walk into SSA and object files → cmd/link consumes objects+importcfg and emits the binary. At runtime, compiled binaries start in runtime.main which enables GC and runs init tasks before main.main.

All 14 data flow claims →

Behavior traces

Four flows were walked end-to-end. (1) Source bootstrap: make.bash → dist → bootstrapBuildTools → go_bootstrap rebuild. (2) 'go build': main → toolchain.Select → lookupCmd → invoke → load → Builder.Do. (3) Module fetch with integrity checks. (4) Runtime program startup and the scheduler loop. Test orchestration via run.bash → dist test → testdir is a fifth traced path.

Testing signals

Testing is massive and layered: package-level Go tests throughout stdlib and cmd, the ~1900-file test/ black-box corpus driven by cmd/internal/testdir with //-directive comments, cmd/go's script-based tests under testdata/script using the cmd/internal/script engine, dist-level orchestration with race/msan/asan/compile-only modes, and API golden tests. CI is not GitHub Actions — .github contains only templates; testing runs on Go's own builder fleet via all.bash/run.bash with sharding support.

Risk map

Highest-risk surfaces: (1) supply-chain code execution — toolchain auto-download+re-exec, module fetches, VCS shell-outs, and cgo/gcc/swig invocation; (2) runtime invariants where a single mistake corrupts all programs (scheduler throws, GC write barriers, linkname/unsafe); (3) bootstrap trust — the build requires a pre-existing Go binary; (4) compatibility enforcement — api/ files and GODEBUG semantics are contractual. Many security gates exist (sumdb verification, IsSecure scheme checks, #cgo flag validation) but bypass knobs (GOINSECURE, GONOSUMDB/GONOSUMCHECK, GIT_ALLOW_PROTOCOL, -insecure) weaken them.

All 14 risk map claims →

Extension points

Extension is table-driven almost everywhere: new 'go' subcommands register in main.go's command table; new architectures add an Init func to cmd/compile's archInits map plus an ssagen.ArchInfo; new SSA passes go in the ordered passes table; new VCS tools extend vcsList; experiments are file-pairs in internal/goexperiment; GODEBUGs register in internal/godebugs/table.go; new stdlib API must add lines to api/next and release notes under doc/next; new test/ cases just drop files into the enumerated dirs.

All 13 extension points claims →

Contributor handoff

Working rules: never build inside a pristine checkout without a bootstrap Go; run tests via the built tree's ../bin/go, not a system go. The safe edit boundary is: stdlib packages are ordinary Go code, but runtime, compiler SSA tables, api/ manifests, and cmd/go internals have hard invariants and generated files. Always read the file's package comment first — cmd/dist, runtime/proc.go, mgc.go and gc/main.go carry long design comments that encode the actual contract. After edits, run the package's own tests plus cmd/internal/testdir for anything touching the toolchain.

All 13 contributor handoff claims →

Languages

LanguageFilesShare of source
Go1171598%
C1451%
Markdown69docs/config
YAML68docs/config
JSON41docs/config
Shell310%
HTML15docs/config
JavaScript90%

Start reading here

Probable source entrypoint: src/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (1935 files) lib/ (14 files)

Source layout — src/

PathFiles
src/archive/32
src/cmd/147

Repository structure

Top-level pathFiles
src/1935
test/1932
doc/38
api/35
misc/20
lib/14
.github/12

Docs found: CONTRIBUTING.mdREADME.md

Package

misc/go.mod — misc, 0 declared dependencies.

CI & config entrypoints

Structural health signals

Average score 7.4/10 across 96 analyzed source files; 9 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history