jprq icon indicating copy to clipboard operation
jprq copied to clipboard

Fix writeerror args

Open stohirov opened this issue 5 months ago • 1 comments

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 avatar Jun 09 '26 06:06 stohirov

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

stohirov avatar Jun 09 '26 06:06 stohirov