From 0415ad3f96a25e9e220c11b12d843c516b2f78f5 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 10 Apr 2019 21:20:49 +0300 Subject: [PATCH] fix WithNoDial to return the context --- options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index 4bdaefb..16d25f1 100644 --- a/options.go +++ b/options.go @@ -10,8 +10,8 @@ var noDial = noDialCtxKey{} // WithNoDial constructs a new context with an option that instructs the network // to not attempt a new dial when opening a stream. -func WithNoDial(ctx context.Context, reason string) { - context.WithValue(ctx, noDial, reason) +func WithNoDial(ctx context.Context, reason string) context.Context { + return context.WithValue(ctx, noDial, reason) } // GetNoDial returns true if the no dial option is set in the context.