aboutsummaryrefslogtreecommitdiff
path: root/pipeln.go
diff options
context:
space:
mode:
Diffstat (limited to 'pipeln.go')
-rw-r--r--pipeln.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/pipeln.go b/pipeln.go
index f085fc3..73efd3f 100644
--- a/pipeln.go
+++ b/pipeln.go
@@ -9,20 +9,6 @@ import (
"golang.org/x/sys/unix"
)
-type addr struct {
- ln *PipeListenerDialer
-}
-
-var _ net.Addr = addr{}
-
-func (addr) Network() string {
- return "pipe"
-}
-
-func (a addr) String() string {
- return "pipe:" + a.ln.addr
-}
-
// PipeListenerDialer can be used to simulate client-server interaction
// within the same process.
type PipeListenerDialer struct {
@@ -90,3 +76,17 @@ func (ln *PipeListenerDialer) DialContextAddr(_ context.Context, addr string) (n
func New(addr string) *PipeListenerDialer {
return &PipeListenerDialer{addr, make(chan net.Conn), make(chan struct{}), true}
}
+
+type addr struct {
+ ln *PipeListenerDialer
+}
+
+var _ net.Addr = addr{}
+
+func (addr) Network() string {
+ return "pipe"
+}
+
+func (a addr) String() string {
+ return "pipe:" + a.ln.addr
+}