aboutsummaryrefslogtreecommitdiff
path: root/pipeln.go
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2021-06-02 12:26:25 +0100
committerGrégoire Duchêne <gduchene@awhk.org>2021-06-02 12:26:25 +0100
commitfd06c81a297abe152d000fa5009bf9f9693d4499 (patch)
tree50adec9fae7858c79b80eb7ac75e590b99dd84a1 /pipeln.go
parent94e59f7ec54ad1bddd78c4b385defaa8cff7c15d (diff)
Move addr below PipeListenerDialerv1.0.0
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
+}