github.com/DaAlbrecht/cf-cli@v0.0.0-20231128151943-1fe19bb400b9/util/clissh/listener_factory.go (about) 1 package clissh 2 3 import "net" 4 5 //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . ListenerFactory 6 7 type ListenerFactory interface { 8 Listen(network, address string) (net.Listener, error) 9 } 10 11 type listenerFactory struct{} 12 13 func DefaultListenerFactory() listenerFactory { 14 return listenerFactory{} 15 } 16 17 func (listenerFactory) Listen(network, address string) (net.Listener, error) { 18 return net.Listen(network, address) 19 }