review: whole-repo comment budget, modern-Go idioms and named func types - #197
Merged
Conversation
Join every remaining multi-line // block into the one-line budget, drop comments that restate the code they sit on (labels, narration, name echoes, interface-method godoc), and tighten package docs that had grown past a sentence. Comment-only changes; no code moved.
Whole-repo /code + /simplify pass on top of the net_scope branch: - cmp.Or / utils.OrDefault / min for hand-rolled fallbacks; slices ContainsFunc/DeleteFunc/Backward and errors.AsType for hand-rolled loops and errors.As+var; errors.Is(fs.ErrNotExist) over os.IsNotExist; utils.FileExists over bare os.Stat probes. - Named func types where one signature was spelled out repeatedly: hypervisor.VMOp, images.PinRecheck, localfile.BlobPinner. - Backend.EffectiveCPUs resolves placement-vs-fence through the CgroupCPUFence seam instead of five backend sites reaching into the raw config field; the --mergeable memory exclusion moves next to its sibling invariants in VMConfig.Validate; config gains BridgeTAPPrefix/NetnsPrefix accessors so cmd/ never spells the scope-to-prefix rule; cgroup's placement error names the persisted field, not a flag. - Trailing/leading comment trims that rode along with the touched lines.
CMGS
force-pushed
the
review/whole-repo-2026-08-17
branch
from
August 17, 2026 08:59
61d9f32 to
4928404
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto master after #196 (net_scope) landed; the third commit refreshes docs/index.md (daemon-optional wording, mergeable memory, net_scope) so the docs match the tree.
What
Whole-repo
/code+/simplifyround with the comment budget as the primary lens. Every.gofile (incl._test.go) was walked; three mechanical scanners (comment audit ×2, rule scan) plus the four/simplifylenses (reuse, simplification, efficiency, altitude) fed candidates that were verified by hand before applying.Three commits:
//block joined to one line (showblocks= 30 → 0 repo-wide), restating/label/narration comments and interface-method godoc dropped, over-long package docs tightened. Prod comment lines 1426 → 1375; test comment lines trimmed accordingly.cmp.Or/utils.OrDefault/minfor hand-rolled fallbacks;slices.ContainsFunc/DeleteFunc/Backward;errors.AsType;errors.Is(fs.ErrNotExist);utils.FileExistsover bareos.Statprobes.hypervisor.VMOp(5 sites),images.PinRecheck(6 sites),localfile.BlobPinner.Backend.EffectiveCPUs(placement-vs-fence resolved once through theCgroupCPUFenceseam instead of five backend sites reading the raw config field);--mergeablememory exclusion moved intotypes.VMConfig.Validatebeside its sibling invariants;config.BridgeTAPPrefix()/NetnsPrefix()accessors socmd/never spells the scope→prefix rule; cgroup placement error names the persisted field.Net: 92 files, +193 / −417.
Not changed (reviewed, judged not worth churn)
storageConfigToDisk's per-diskqueueAffinityrecompute (launch path, microseconds; adiskPolicystruct would touch six signatures).vm debugre-implementing half ofbuildCLIArgs— user-visible output format; separate change if wanted.Evidence
make lintGOOS=linux + darwin: 0 issues;asl ./...both GOOS: clean (pre-commit hook enforced on both commits)go test ./...darwin: greengo test -count=1 ./...on Linux (dockergolang:1.26.5-bookworm, linux/arm64): green — the amd64-emulated image failsdaemonwatcher (pidfd/epoll) andhypervisorstub-VMM exec tests identically on the base commit, i.e. an emulation artifact, not this branch