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

Commit

Permalink
Merge pull request #43 from libp2p/fix/no-dial
Browse files Browse the repository at this point in the history
fix WithNoDial to return the context
  • Loading branch information
vyzo authored Apr 10, 2019
2 parents 673b626 + 0415ad3 commit e1b54a3
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 e1b54a3

Please sign in to comment.