Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: net: add BufferedPipe (buffered Pipe) #34502
If one wants to connect two Go libraries which use the
A native Go transport would be more ideal, but expecting users to implement their own is maybe not reasonable as the net.Conn and net.Listener interfaces are difficult to implement correctly. I propose that we add a canonical and cross-platform in-memory transport in either
Further, I propose the following interface:
func NewConnPair(addr1, addr1 net.Addr) (net.Conn, net.Conn)
func NewPacketConnPair(addr1, addr1 net.Addr) (net.PacketConn, net.PacketConn)
func NewDialerListenerPair(dialAddr, listenAddr net.Addr) (func(context.Context) (net.Conn, error), net.Listener)
Maybe it would be better to create new exported types and return those instead of the interfaces (e.g.
Right now we have in package net:
It sounds like the minimal addition here to solve the problem would be
I believe packages could build arbitrary other things easily on top of that.
Do people agree that this is the right path forward?