]> Cypherpunks repositories - gostls13.git/commitdiff
net: remove types InvalidConnError and UnknownSocketError
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 31 Jan 2012 23:04:42 +0000 (15:04 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 31 Jan 2012 23:04:42 +0000 (15:04 -0800)
Both are unused and undocumented.

InvalidConnError is also non-idiomatic: a FooError type can
typically describe something, else it would be an ErrFoo
variable.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5609045

src/pkg/net/fd.go
src/pkg/net/fd_windows.go
src/pkg/net/sock.go

index 98e5a695026f64301310aa42c1bf5f76adbea655..2352d22e115d6461acbb9a12dccee0ff882dc721 100644 (file)
@@ -43,12 +43,6 @@ type netFD struct {
        ncr, ncw int
 }
 
-type InvalidConnError struct{}
-
-func (e *InvalidConnError) Error() string   { return "invalid Conn" }
-func (e *InvalidConnError) Temporary() bool { return false }
-func (e *InvalidConnError) Timeout() bool   { return false }
-
 // A pollServer helps FDs determine when to retry a non-blocking
 // read or write after they get EAGAIN.  When an FD needs to wait,
 // send the fd on s.cr (for a read) or s.cw (for a write) to pass the
index 0f89868e390dc60baa2476655c8d7b63a280d000..78168eb6c861436f43bdd8ee5c6e6753eaa66bc1 100644 (file)
@@ -14,12 +14,6 @@ import (
        "unsafe"
 )
 
-type InvalidConnError struct{}
-
-func (e *InvalidConnError) Error() string   { return "invalid Conn" }
-func (e *InvalidConnError) Temporary() bool { return false }
-func (e *InvalidConnError) Timeout() bool   { return false }
-
 var initErr error
 
 func init() {
index 2dbe1082e41c689d887554dac17dd1f0386e326c..70064c307ef36b5319d3a341c5829ecf318325b7 100644 (file)
@@ -10,7 +10,6 @@ package net
 
 import (
        "io"
-       "reflect"
        "syscall"
 )
 
@@ -70,14 +69,6 @@ func socket(net string, f, t, p int, la, ra syscall.Sockaddr, toAddr func(syscal
        return fd, nil
 }
 
-type UnknownSocketError struct {
-       sa syscall.Sockaddr
-}
-
-func (e *UnknownSocketError) Error() string {
-       return "unknown socket address type " + reflect.TypeOf(e.sa).String()
-}
-
 type writerOnly struct {
        io.Writer
 }