DUP-GO-9: requireGET and requirePOST differ only in method string #52
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#52
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
requireGET(lines 323–332) andrequirePOST(lines 334–343) ininternal/server/server.goare 9-line functions that are structurally identical, differing only in the HTTP method string.Fix
Extract a
requireMethod(method string) func(http.Handler) http.Handlerfactory.requireGETandrequirePOSTbecome one-liner wrappers.Effort
Trivial. Low value — current code is clear and readable, but adds friction when adding a new method.