make mocking conns slightly easier for handleNewTCPConn()
If using a non-IP based net.Conn you will need to wrap and mock / override RemoteAddr() to make sure it does return a net.IP.
remoteIP := getRemoteAsIP(clientConn)
if remoteIP == nil {
// Socket returned non-IP Remote Address - we can't really use that. If testing w/ pipe try
// wrapping with struct to provide mock RemoteAddr which return a real IP address.
return
}
make mocking conns slightly easier for
handleNewTCPConn()
If using a non-IP based
net.Conn
you will need to wrap and mock / overrideRemoteAddr()
to make sure it does return a net.IP.