Radar · Go · #003 · Week 41 · Oct 5 – 11, 2026
Deprecate DNSConfigError in net
Worth knowingstdlib
- What changed
- The proposal to deprecate the unused type DNSConfigError was accepted.
- Production impact
- The source does not say.
- Try it
- Run
go vetto ensure no code references net.DNSConfigError. - Source
- github.com/golang/go/issues/63118
Understand it, then run it
The Go standard library once defined a type named DNSConfigError in the net package. It was meant to represent a failure while reading the system’s DNS configuration, but the code that could produce it was removed long ago. Because the type is no longer used, the Go team has marked it as deprecated. Deprecation means the type will stay in the source for now so existing programs don’t break, but new code should avoid referring to it and it may disappear in a future release.
If you have never looked at the net package source, you can think of a type as a custom error that a function might return. In this case, no function returns DNSConfigError any more, so you will never see it in practice.
When you read Go documentation, you’ll now see a deprecation note next to DNSConfigError. Treat that as a signal to stop using the name in any new code you write.
Run it now
package main
import (
"fmt"
"net"
)
// This program demonstrates that DNSConfigError still exists but is unused.
// In Go 1.27.1 the type is present for compatibility; no function returns it.
func main() {
// Create a value of the deprecated type manually.
// This compiles, but real net code will never produce such an error.
var err net.DNSConfigError
fmt.Printf("Deprecated type value: %#v\n", err)
// Show that typical net functions do not return DNSConfigError.
_, lookupErr := net.LookupHost("example.com")
if lookupErr != nil {
// The error is of type *net.DNSError, not DNSConfigError.
fmt.Printf("Lookup error type: %T\n", lookupErr)
}
}
What it printed when we ran it on Go 1.27.1
Deprecated type value: net.DNSConfigError{Err:error(nil)}
Lookup error type: *net.DNSError
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-120b from the linked source · claims checked against the sources · human-reviewed