Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
fix WithNoDial to return the context
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Apr 10, 2019
1 parent 673b626 commit 0415ad3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0415ad3

Please sign in to comment.