aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2021-02-13 18:19:57 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2021-02-13 18:27:46 +0000
commit37aca255931ccb4bc35dc3bd0f32f8e8ada24e6e (patch)
tree7778dec2446bc1aa1a0009321d826c7cf0bb21bb
parentfcc1f852131a7eaf026f172cd54ce6db3b79bc04 (diff)
Add PipeListenerDialer.DialContextAddrv0.1.0
Makes it easier to use with grpc.WithContextDialer.
-rw-r--r--pipeln.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pipeln.go b/pipeln.go
index 8ff6a62..507ab33 100644
--- a/pipeln.go
+++ b/pipeln.go
@@ -73,6 +73,10 @@ func (ln *PipeListenerDialer) DialContext(_ context.Context, network, addr strin
return ln.Dial(network, addr)
}
+func (ln *PipeListenerDialer) DialContextAddr(_ context.Context, addr string) (net.Conn, error) {
+ return ln.Dial("", addr)
+}
+
func New(addr string) *PipeListenerDialer {
return &PipeListenerDialer{addr, make(chan net.Conn), make(chan struct{})}
}