Skip to content

docs(#6785): add text/template sorted map iteration to Go review guidance - #6786

Open
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/6785-template-map-iteration-guidance
Open

docs(#6785): add text/template sorted map iteration to Go review guidance#6786
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/6785-template-map-iteration-guidance

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds a "Template map iteration" review directive to docs/contributing/go-code.md to prevent the review agent from flagging range over basic-type-keyed maps in text/template as non-deterministic. Go's text/template package guarantees sorted iteration for string, int, and float keys — a documented exception to Go's general unordered map iteration.

Related Issue

Changes

  • Added a new ### Template map iteration subsection under ## Go pitfalls in docs/contributing/go-code.md
  • Includes a "When reviewing PRs" directive following the established pattern of the Timeout() bool and suite-timeout directives
  • Links to the official text/template documentation

Testing

  • No Go production code changed — docs-only change
  • Pre-commit hooks verified (trailing whitespace, end-of-file, link checks)
  • Secret scan passed
  • Gitlint passed

Closes #6785

Post-script verification

  • Branch is not main/master (agent/6785-template-map-iteration-guidance)
  • Secret scan passed (gitleaks — b00042354a39a430b7658aa186ab95690fdfbbb4..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

…ance

The review agent repeatedly flagged `range` over a map inside
`text/template` as non-deterministic output, applying the general Go
heuristic that map iteration order is unspecified. However, Go's
`text/template` package documents that `range` visits map keys of
basic types (string, int, float) in sorted order.

Add a "Template map iteration" subsection to the Go pitfalls section
of `docs/contributing/go-code.md` with a "When reviewing PRs"
directive, following the established pattern of the `Timeout() bool`
and suite-timeout directives already in the file. This prevents the
review agent from re-raising this false positive.

Closes #6785
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 30, 2026 21:14
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 30, 2026
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Site preview

Preview: https://6403aa4e-site.fullsend-ai.workers.dev

Commit: 1cd5370ff93e2f5867318cca13f171e1516ff2b2

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:16 PM UTC · Completed 9:29 PM UTC

Commit: 68f351e · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.37

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/low PR risk: low label Aug 30, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

Risk Assessment: low (1/5)

Details

Docs-only PR by a bot adding 15 lines to a single contributing guide, with no protected paths, no security-sensitive files, and exact scope match to the linked issue.

Previous run

Risk Assessment: low (1/5)

Details

Docs-only PR by a bot adding 15 lines to a single contributing guide, with no protected paths, no security-sensitive files, and exact scope match to the linked issue.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

Looks good to me

Previous run

Review

Findings

Low

  • [technical accuracy] docs/contributing/go-code.md:314 — The parenthetical list of basic types says "(string, int, float)" but omits unsigned integer types (uint, uint8, uint16, uint32, uint64) which are also basic types with a defined order that receive sorted iteration in text/template. The official Go documentation says "basic type with a defined order" without limiting to only string/int/float. The "When reviewing PRs" directive on line 323 repeats the incomplete list ("string, int, and float keys") without the "basic types" qualifier, making the omission more consequential — a reviewer reading this guidance might incorrectly conclude that a map[uint64]T would NOT get sorted iteration in a template.
    Remediation: Expand the parenthetical to "(string, int, uint, float)" or use the official phrasing "basic type with a defined order" to match the upstream documentation. Apply the same fix to the "When reviewing PRs" directive on line 323.

Labels: PR modifies only documentation under docs/contributing/


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the component/docs User-facing documentation label Aug 30, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 9:31 PM UTC · Completed 9:36 PM UTC

Commit: 68f351e · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.03

Add uint to the parenthetical list of basic types that receive sorted
iteration in text/template, and update the "When reviewing PRs"
directive to match. The Go text/template documentation specifies
"basic type with a defined order" which includes unsigned integer
types — omitting them could mislead reviewers into flagging
map[uint64]T iteration as non-deterministic.

Addresses review feedback on #6786
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Addressed 1 review finding: expanded the basic type list in both the description and the reviewer directive to include uint alongside string, int, and float, matching the upstream text/template documentation.

Fixed (1):

  1. Incomplete basic type list omits uint types in template map iteration guidance (docs/contributing/go-code.md): Added uint to the parenthetical list on line 314 ("string, int, uint, float") and updated the "When reviewing PRs" directive on line 323 to include "uint" in the enumerated key types. The Go text/template documentation specifies sorted iteration for "basic type with a defined order" which includes unsigned integer types.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:38 PM UTC · Completed 9:50 PM UTC

Commit: 1cd5370 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.14

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation ready-for-merge All reviewers approved — ready to merge ready-for-review Agent PR ready for human review risk/low PR risk: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add text/template sorted map iteration to Go review guidance

0 participants