mirror of
https://github.com/golang/go
synced 2024-11-12 06:30:21 -07:00
net: move DNSConfigError to a portable file
The type being unavailable on Windows was the only API signature difference in the net package. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5608043
This commit is contained in:
parent
64a73b0355
commit
549ca930a0
@ -17,19 +17,6 @@ type dnsConfig struct {
|
||||
rotate bool // round robin among servers
|
||||
}
|
||||
|
||||
var dnsconfigError error
|
||||
|
||||
type DNSConfigError struct {
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e *DNSConfigError) Error() string {
|
||||
return "error reading DNS config: " + e.Err.Error()
|
||||
}
|
||||
|
||||
func (e *DNSConfigError) Timeout() bool { return false }
|
||||
func (e *DNSConfigError) Temporary() bool { return false }
|
||||
|
||||
// See resolv.conf(5) on a Linux machine.
|
||||
// TODO(rsc): Supposed to call uname() and chop the beginning
|
||||
// of the host name to get the default search domain.
|
||||
|
@ -201,3 +201,15 @@ type UnknownNetworkError string
|
||||
func (e UnknownNetworkError) Error() string { return "unknown network " + string(e) }
|
||||
func (e UnknownNetworkError) Temporary() bool { return false }
|
||||
func (e UnknownNetworkError) Timeout() bool { return false }
|
||||
|
||||
// DNSConfigError represents an error reading the machine's DNS configuration.
|
||||
type DNSConfigError struct {
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e *DNSConfigError) Error() string {
|
||||
return "error reading DNS config: " + e.Err.Error()
|
||||
}
|
||||
|
||||
func (e *DNSConfigError) Timeout() bool { return false }
|
||||
func (e *DNSConfigError) Temporary() bool { return false }
|
||||
|
Loading…
Reference in New Issue
Block a user