Skip to content

Fix writeerror args#300

Open
stohirov wants to merge 3 commits into
azimjohn:masterfrom
stohirov:fix-writeerror-args
Open

Fix writeerror args#300
stohirov wants to merge 3 commits into
azimjohn:masterfrom
stohirov:fix-writeerror-args

Conversation

@stohirov

@stohirov stohirov commented Jun 9, 2026

Copy link
Copy Markdown

Fix WriteError to spread args into Sprintf

WriteError(w, message, args...) passed args (a []string) to fmt.Sprintf as a single argument instead of spreading it, so any multi-arg error message rendered incorrectly. Now converts []string → []any and spreads with args.... Affects all existing WriteError callers.

NoArg:
Input: "subdomain is busy"
before: subdomain is busy%!(EXTRA []string=[])
after: subdomain is busy

SingleArg:
Input: "subdomain is busy: %s", "foo"
Before: subdomain is busy: [foo]
After: subdomain is busy: foo

MultiArg:
Input: "cname %s does not point to %s", "a.com", "b.jprq.live"
Before: cname [a.com b.jprq.live] does not point to %!s(MISSING)
After: cname a.com does not point to b.jprq.live

@stohirov

stohirov commented Jun 9, 2026

Copy link
Copy Markdown
Author
Screenshot 2026-06-09 at 11 21 31

Bug confirmed at prod as well

Before:
jprq is now invite-only service [
buy membership - https://buymeacoffee.com/azimjon
]

After:
jprq is now invite-only service
buy membership - https://buymeacoffee.com/azimjon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant