The Wire · Showcase
GO STRIPS LEGACY CODE.GOOGLE.COM PATHS, HTTP/2 HOST HEADER FIX LANDS
By RepoJournal · Filed · About Go
The Go toolchain removed an unreachable staleness check dating to Google Code's 2016 shutdown, while the HTTP/2 implementation now correctly strips Host headers from request maps to match documented behavior.
cmd/go/internal/load dropped the StalePath check [1] that reported errors for code.google.com/p/go.tools imports, a path that became unfetchable the moment Google Code shut down eight years ago. The removal closes an old TODO in the loader. Meanwhile, net/http/internal/httpcommon [2] fixed a behavioral gap: the http.Request documentation promises that incoming Host headers are promoted to the Request.Host field and removed from the Header map, but HTTP/2 was keeping them in the map when no :authority pseudo-header arrived. This change aligns implementation with spec. On the analyzer front, golang/tools patched two widespread bugs across its static checkers. The modernize pass [5] now refuses to rewrite backward slice loops with assignment-form initialization (i = len(s)-1), since converting to a range loop would declare a new variable and change post-loop behavior. More broadly, multiple analyzers [6] were panicking on multi-valued call arguments like net.Dial(dialArgs()), where one AST node represents two return values; the fix adds argument count checks before indexing. VS Code's Go extension [4] now prefers gopls' native implement-interface command over the external impl tool when available, part of a larger migration to built-in commands [3]. The build infrastructure also tightened buffer handling [7]: repeated buildlet connections no longer leak unread bytes that could corrupt subsequent reads from the network socket.
One email a day. Unsubscribe in one click.
Keep up with Go in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review Host header behavior in any HTTP/2 reverse proxies or middleware reading raw request headers golang/go [plan]
- → Rerun static analysis on your codebase with updated golang/tools to catch panics on multi-valued call arguments golang/tools [monitor]
- → Update VS Code Go extension to leverage gopls implement-interface if your team relies on code generation golang/vscode-go [monitor]
References
- [1] cmd/go/internal/load: remove StalePath check golang/go
- [2] net/http/internal/httpcommon: remove Host header from server request golang/go
- [3] extension/src/goImpl: collect telemetry for the vscode command golang/vscode-go
- [4] extension/src/goimpl: use gopls command if available golang/vscode-go
- [5] go/analysis/passes/modernize: avoid changing assignment-form slicesbackward loops golang/tools
- [6] go/analysis: avoid panics on multi-valued call arguments golang/tools
- [7] buildlet: ensure bytes are drained before network connection golang/build