lint: resolve all gocritic findings #583
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#583
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
gocritic reports 13 findings under the default check set. Two of them may be
real bugs, not style.
What
Fix every gocritic finding. Handle these classes:
appendAssignatinternal/cmd/git/diff.go:72,79: the append result isassigned to a different slice than the one it was called on. Confirm whether
this is a real argument-construction bug before rewriting.
mapKeyatinternal/service/issue_close_reason_test.go:185: a suspicious" closed "key with surrounding whitespace. Confirm whether the whitespaceis the point of the test or a bug.
unlambda: single-use wrapper closures ininternal/service/git/status.go,internal/mcp/tools_admin_hooks.go,internal/mcp/tools_repos_meta.go,internal/service/workflow/helpers.go,internal/cmd/repo/repo_content.go.Replace with direct function references. The status.go case is a test
injection seam; check for tests that rely on the closure before collapsing
it.
ifElseChainx2,elseifx2,deprecatedCommentx1: mechanical rewrites.Files touched:
internal/cmd/git/diff.go,internal/cmd/repo/repo_content.go,internal/config/git.go,internal/format/format.go,internal/format/prune/result.go,internal/gitea/client_flavour_test.go,internal/mcp/tools_admin_hooks.go,internal/mcp/tools_issues_test.go,internal/mcp/tools_repos_meta.go,internal/service/git/status.go,internal/service/issue_close_reason_test.go,internal/service/workflow/helpers.go.Acceptance
go test ./...stays green.not just silenced.