Created
October 10, 2013 17:12
-
-
Save bernerdschaefer/6922041 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// like io.Pipe(), but returns two connected ReadWriteClosers. | |
func newConn() (io.ReadWriteCloser, io.ReadWriteCloser) { | |
type rwc struct { | |
io.Reader | |
io.WriteCloser | |
} | |
rs, wc := io.Pipe() | |
rc, ws := io.Pipe() | |
return &rwc{rc, wc}, &rwc{rs, ws} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment