1
0
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:
Brad Fitzpatrick 2012-01-31 13:01:34 -08:00
parent 64a73b0355
commit 549ca930a0
2 changed files with 12 additions and 13 deletions

View File

@ -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.

View File

@ -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 }