Open-Source Wikis

/

Go

/

By the numbers

golang/go

By the numbers

A quantitative snapshot of the golang/go repository. Data collected on 2026-04-30 at commit fdd592745d on master.

Size

The repo is dominated by Go source under src/, with a long tail of platform-specific assembly and a substantial test corpus.

Category Count
.go files (total) 11,249
.go files (non-test) 6,070
_test.go files 1,813
.s assembly files 634
.c / .h files 146
.md files 70
Total repo size on disk ~627 MB
src/ size ~152 MB
xychart-beta horizontal
    title "Source files by language (under src/)"
    y-axis "Language"
    x-axis "Files"
    bar [11249, 1813, 634, 146]

The bars above are roughly proportional to file counts: Go (11.2k, including ~1.8k tests), Go test files (1.8k subset), assembly (634), and C/header (146). Assembly is mostly per-architecture runtime support; the C code is almost entirely cgo support and a small amount of runtime glue.

Largest source files

A handful of files dominate by line count. They are each at the heart of a major subsystem.

File Lines What lives there
src/runtime/proc.go 8,156 The G-M-P scheduler
src/runtime/malloc.go 2,501 Allocator entry points and tiny allocator
src/runtime/mgc.go 2,315 Mark phase of the GC
src/runtime/panic.go 1,788 Panic, recover, and defer
src/runtime/chan.go 970 Channel implementation
src/cmd/go/alldocs.go (generated) Concatenated go command help text
src/cmd/compile/internal/ssa/rewritegeneric.go (generated) Generic SSA rewrite rules
src/cmd/compile/internal/ssa/opGen.go (generated) Generated SSA op tables

Many of the largest files in cmd/compile/internal/ssa and cmd/internal/obj/* are generated from .rules and tables — they are intentionally enormous and not edited by hand.

Activity

Recent commit cadence on master:

Window Commits
Last 30 days ~ depends on snapshot
Last 6 months 1,592
Last 12 months 3,245
All-time 66,144
Unique commit authors (all-time) 2,842

Go has a steady, high commit volume — measured in hundreds per month — driven by a relatively concentrated core team plus a long tail of community contributions through Gerrit code review.

Hotspots in the last 90 days

The most-changed files in the last 90 days, as a rough proxy for where active development is happening:

File Touches Subsystem
src/cmd/internal/obj/arm64/asm7.go 19 ARM64 assembler
src/cmd/compile/internal/noder/writer.go 17 Unified IR writer
src/cmd/compile/internal/ssa/rewritegeneric.go 15 SSA rewrites (generated)
src/cmd/compile/internal/ssa/_gen/generic.rules 15 SSA rewrite source rules
src/cmd/internal/obj/arm64/encoding_gen.go 14 ARM64 encoder (generated)
src/cmd/go/alldocs.go 14 go command docs (generated)
src/cmd/compile/internal/noder/reader.go 14 Unified IR reader
src/cmd/internal/obj/arm64/inst_gen.go 13 ARM64 instruction definitions
src/cmd/internal/obj/arm64/goops_gen.go 13 ARM64 op definitions
src/cmd/internal/obj/arm64/anames_gen.go 13 ARM64 op name tables
src/cmd/go/internal/modload/init.go 13 Module loader init
src/cmd/compile/internal/ssa/opGen.go 13 SSA op tables (generated)
src/cmd/asm/internal/asm/testdata/arm64sveerror.s 13 ARM64 SVE assembler test data
src/cmd/asm/internal/asm/testdata/arm64sveenc.s 13 ARM64 SVE encoding test data
src/net/http/internal/http2/server_test.go 13 net/http2 server tests
src/cmd/internal/obj/loong64/asm.go 12 LoongArch64 assembler

Two dominant themes emerge:

  1. ARM64 SVE work. A large portion of recent churn is in the ARM64 assembler / encoder around SVE (Scalable Vector Extension) support.
  2. Compiler middle end. The Unified IR (noder/writer.go, noder/reader.go) and SSA rewrite layer continue to see steady changes.

Bot-attributed commits

This repository's history shows 0 commits with Co-authored-by: trailers that match the common bot account patterns (*[bot]). The Go project does not use dependabot or similar GitHub bots on the master branch — module updates and dependency bumps go through the regular Gerrit review process and are attributed to human reviewers.

Go contributors do use AI-assisted tools, but the project's CL workflow does not embed a Co-authored-by trailer for them, so a precise bot-vs-human breakdown is not available from git metadata alone. Take this number as a lower bound on AI-assisted commits — it likely understates reality.

Complexity hotspots

src/runtime/proc.go is the canonical "go-to" file when working on the scheduler, and its 8,000+ lines reflect a long history of accumulated cases (preemption, work-stealing, network polling integration, sysmon, race-detector cooperation, GC coordination, GOMAXPROCS adjustment, profiling, …). It is large by necessity and intentionally not split — many functions have to be in a single package due to runtime self-bootstrapping constraints.

Several files under src/cmd/compile/internal/ssa/ (e.g., rewritegeneric.go, opGen.go, rewriteARM64.go) and src/cmd/internal/obj/<arch>/ are generated from rule files (*.rules, *_gen.go). They are large but not edited by hand. To change them, edit the source .rules or _gen.go and run go generate.

Test-to-code ratio

Across src/, there are ~1,813 _test.go files and ~6,070 non-test .go files. That's roughly 1 test file for every 3.3 non-test files — a meaningful but not exhaustive ratio at the file level.

The story is richer than the file count suggests: many subsystems also have tests in test/ (top-level Go program tests run via cmd/internal/testdir), and others rely on Gerrit's "trybots" to run end-to-end suites across many platforms before merge. The standard library's coverage tends to be thorough; the runtime's lower-level paths are exercised mostly via integration tests in runtime/crash_test.go and friends.

TODO / FIXME footprint

A scan of TODO, FIXME, XXX, and HACK comments across .go files (top several levels of src/) returns roughly 1.5k matches. Many are aspirational notes left next to the relevant code rather than open tickets — Go contributors are encouraged to file an issue for actionable items and reference the issue ID in code comments. See cleanup-opportunities/ (if added) for a deeper dive.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – Go wiki | Factory