$ the-wire · showcase
Deprecations land in net and go/build, gopls fixes shadowing and overlay handling
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
Today's Go work is cleanup and correctness: two standard-library deprecations, a removal of dead runtime state, and a batch of gopls fixes touching shadowing, unsaved-buffer handling, and cross-file declaration moves.
net: deprecate DNSConfigError golang/go
net.DNSConfigError is now deprecated, joining the house-cleaning of error types the package no longer wants callers depending on. Code that type-asserts or checks for it keeps compiling, but new code should stop treating it as part of the API.
go/build: mark ArchChar() as deprecated golang/go
go/build.ArchChar() is marked deprecated as well, so tools that map GOARCH to a single-character code should move off it before the next removal cycle.
gopls/internal/cache: pass overlays to go mod commands golang/tools
gopls now passes -overlay to go mod commands, which it previously did not despite always writing the overlay file, so go mod tidy read Go files from disk and ignored unsaved edits; that also produced races with file save events. Because tidy now sees unsaved buffers, its cached results no longer need invalidating on save, which is why some tests flaked.
gopls/internal/cache: fix shadowing bug golang/tools
A classic Go shadowing bug in gopls/internal/cache could make getOneTransitiveRefLocked return nil spuriously in some cases. Alan Donovan's own description keeps it in proportion: it is "unlikely be a common or serious bug," caught from a test case reported by pjw.
gopls/internal/lsprpc: adjust dial retry logic golang/tools
gopls replaced its fixed 5-attempt, 1-second dial retry loop with exponential backoff starting at 50ms over 8 attempts. Normal daemon cold-starts get faster, while heavily loaded race builders get more time for the daemon subprocess to bind its socket.
windows/mkwinsyscall: read 32-bit results from the low half of the return register golang/sys
mkwinsyscall now reads BOOL, DWORD, LSTATUS, NTSTATUS, and HRESULT results through uint32, since the upper 32 bits of the return register are undefined for 32-bit return types on 64-bit Windows. Hooked or non-conforming implementations could leave garbage there and the generated code read it as a failure or the wrong error code.
cmd/compile: mark function values of reflect.Value.Method and MethodByName golang/go
The compiler now marks function values produced by reflect.Value.Method and reflect.Value.MethodByName, closing a gap left when the linker check that set reflectSeen was removed. A method expression used as a value, f := reflect.Value.MethodByName, was neither a call nor an emitted wrapper, so nothing marked it.
cmd/link: remove extra -Wl,-nopie for openbsd linking golang/go
cmd/link no longer adds an extra -Wl,-nopie when linking for OpenBSD, since -nopie or -no-pie is already selected from the configured linker capabilities. That redundant flag broke cross-compiling from Linux to OpenBSD, where the linker does not support it.