diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/net/net.go | |
parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
download | golang-8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1.tar.gz |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/pkg/net/net.go')
-rw-r--r-- | src/pkg/net/net.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/pkg/net/net.go b/src/pkg/net/net.go index 2e6db5551..ca56af54f 100644 --- a/src/pkg/net/net.go +++ b/src/pkg/net/net.go @@ -275,7 +275,16 @@ type Listener interface { Addr() Addr } -var errMissingAddress = errors.New("missing address") +// Various errors contained in OpError. +var ( + // For connection setup and write operations. + errMissingAddress = errors.New("missing address") + + // For both read and write operations. + errTimeout error = &timeoutError{} + errClosing = errors.New("use of closed network connection") + ErrWriteToConnected = errors.New("use of WriteTo with pre-connected connection") +) // OpError is the error type usually returned by functions in the net // package. It describes the operation, network type, and address of @@ -337,10 +346,6 @@ func (e *timeoutError) Error() string { return "i/o timeout" } func (e *timeoutError) Timeout() bool { return true } func (e *timeoutError) Temporary() bool { return true } -var errTimeout error = &timeoutError{} - -var errClosing = errors.New("use of closed network connection") - type AddrError struct { Err string Addr string |