How does one test net.Conn in unit tests in Golang?

I’m currently looking into creating some unit tests for net.Conn interface in Go, as well as other functions that build up on top of that functionality, and I’m wondering what is the best way to unit test that in Google Go? My code looks like:

conn, _:=net.Dial("tcp", "")
fmt.Fprintf(conn, "test")
buffer:=make([]byte, 100)

Is the most efficient way of testing this code and the code that uses these functions to spin up a separate goroutine to act like the server, use net.http.httptest package, or something else?