style: apply the gopls quick fixes and fix their stale comments #644

Merged
hexajon merged 3 commits from issue-631-apply-gopls-quick-fixes into main 2026-09-28 18:45:43 +00:00
Owner

Summary

gopls reported findings on main that have quick fixes. This applies all of them: tagged switches, fmt.Fprintf in place of WriteString(fmt.Sprintf(...)), split WriteString concatenations, and three unused parameters (ctx in getConfigForURL, method in enrichOwnerRepoError, err in failResult).

The removed parameters left two doc comments that still named them, in failResult and enrichOwnerRepoError. I rewrote both.

The Decision issues list change in #642 added one more split-WriteString finding, in internal/service/adr/adr.go. This applies that fix too.

gopls check -severity=hint over the whole module now reports only the findings that #624 handles: the nil context in internal/gitexec/env_test.go and the deprecated roots call in internal/mcp/repoguard.go. ./scripts/gate.sh passes.

Closes #631.

Closes #631

## Summary gopls reported findings on main that have quick fixes. This applies all of them: tagged switches, `fmt.Fprintf` in place of `WriteString(fmt.Sprintf(...))`, split `WriteString` concatenations, and three unused parameters (`ctx` in `getConfigForURL`, `method` in `enrichOwnerRepoError`, `err` in `failResult`). The removed parameters left two doc comments that still named them, in `failResult` and `enrichOwnerRepoError`. I rewrote both. The Decision issues list change in #642 added one more split-`WriteString` finding, in `internal/service/adr/adr.go`. This applies that fix too. `gopls check -severity=hint` over the whole module now reports only the findings that #624 handles: the nil context in `internal/gitexec/env_test.go` and the deprecated roots call in `internal/mcp/repoguard.go`. `./scripts/gate.sh` passes. Closes #631. Closes #631
gopls reported 29 findings the gate does not check. This applies gopls's own
fix for each:

- fmt.Fprintf in place of WriteString(fmt.Sprintf(...)) (17)
- separate WriteString calls in place of string concatenation (5)
- tagged switches (4, three of them in tests)
- remove the unused parameters: ctx from getConfigForURL, method from
  enrichOwnerRepoError, and err from finishRun.failResult, with their
  callers (3)

The whoami "unverified" line now uses a plain hyphen.

Refs #624
The gopls quick fixes also changed the em-dash in the whoami "unverified"
line to a plain hyphen. That change is not a gopls fix, so I put the
em-dash back. It matches the other output strings again.

The failResult doc comment still described the err parameter that the
quick fixes removed. It now says that failResult takes no error.

Refs #631
style: apply the gopls quick fixes and fix their stale comments
Some checks failed
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 58s
drift / forgejo-smoke (pull_request) Has been skipped
ci / mcp-conformance (pull_request) Successful in 1m46s
ci / mcp-conformance (push) Successful in -8s
drift / forgejo-smoke (push) Has been skipped
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in -10s
ci / gate (pull_request) Failing after 9m48s
ci / gate (push) Successful in 12m48s
9651258180
Closes #631
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!644
No description provided.