DUP-GO-8: resolvePort + json.Marshal + postJSON pattern repeated 9 times in operations.go #43
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#43
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?
Summary
Nine consecutive mutating operations in
internal/platforms/opencode/operations.go(lines 330–494) all follow the same 8–12 line pattern:The
fmt.Errorf("marshal request: %w", err)wrapping appears identically 8 times.Fix
Extract a
marshalOrErr(v any) ([]byte, error)helper for the marshal step. Consider a table-driven approach for the nine operations to reduce the file further.Effort
Medium.