In Go, a TCP connection (net.Conn) is a io.ReadWriteCloser. I\'d like to test my network code by simulating a TCP connection. There are two requirements that I have:
Most of the cases you do not need to mock net.Conn.
You always can run a goroutine in your test code that will imitate the other side.