1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
package testing
import (
"net"
"os"
)
type Fds struct{}
// Listen returns a listener by calling net.Listen directly
//
// Note: In the stub implementation, this is the only function that
// actually does anything
func (f *Fds) Listen(network, addr string) (net.Listener, error) {
return net.Listen(network, addr)
}
// Listener always returns nil, since it is impossible to inherit with
// the stub implementation
func (f *Fds) Listener(network, addr string) (net.Listener, error) {
return nil, nil
}
// AddListener does nothing, since there is no reason to track connections
// in the stub implementation
func (f *Fds) AddListener(network, addr string, ln net.Listener) error {
return nil
}
// Conn always returns nil, since it is impossible to inherit with
// the stub implementation
func (f *Fds) Conn(network, addr string) (net.Conn, error) {
return nil, nil
}
// AddConn does nothing, since there is no reason to track connections
// in the stub implementation
func (f *Fds) AddConn(network, addr string, conn net.Conn) error {
return nil
}
// File always returns nil, since it is impossible to inherit with
// the stub implementation
func (f *Fds) File(name string) (*os.File, error) {
return nil, nil
}
// AddFile does nothing, since there is no reason to track connections
// in the stub implementation
func (f *Fds) AddFile(name string, file *os.File) error {
return nil
}
|