From 9c2f8c7c29c3388d836ca4173e9a322868abe42d Mon Sep 17 00:00:00 2001 From: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:41:09 +0000 Subject: [PATCH] docs(#6638): fix doc comment guidance for injectable function variables The "Injectable function variables (test seams)" section in go-code.md documented an inaccurate doc comment convention: it said to start comments with "Override in tests to..." but every codebase example (RetrySleepFn, BuildWASMFn, execCombinedOutputFn, resolveOverrideFn) starts with the variable name per Go doc-comment convention, with "Override in tests to..." as a later sentence. Two fixes: - Correct the doc comment rule to say "starting with the variable name" with an "Override in tests to..." sentence, matching actual codebase usage. - Note that both exported (XxxFn) and unexported (xxxFn) variables follow the Fn-suffix pattern, since the section previously only mentioned the exported form. Closes #6638 --- docs/contributing/go-code.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributing/go-code.md b/docs/contributing/go-code.md index 125899e22b..3d44e31d8e 100644 --- a/docs/contributing/go-code.md +++ b/docs/contributing/go-code.md @@ -288,9 +288,9 @@ See [`forge.IsTransient`](../../internal/forge/forge.go) for the canonical examp Package-level variables that hold function values for test overriding must: -- Use an `XxxFn` suffix (e.g., `BuildWASMFn`, `RetrySleepFn`, `WranglerWhoamiFn`) +- Use an `XxxFn` suffix (e.g., `BuildWASMFn`, `RetrySleepFn`, `WranglerWhoamiFn`). Both exported (`XxxFn`) and unexported (`xxxFn`) variables follow this suffix pattern - Default to the real implementation -- Include a doc comment starting with "Override in tests to..." that describes what the override achieves +- Include a doc comment following Go convention (starting with the variable name) that contains an "Override in tests to..." sentence describing the override behavior - Be restored in a `t.Cleanup` callback when overridden Examples: `internal/sandbox/sandbox.go` (`RetrySleepFn`), `internal/dispatch/cf/provisioner.go` (`BuildWASMFn`, `CopyWASMExecFn`).