Skip to content

Commit

Permalink
docs: add comment about contextDialer
Browse files Browse the repository at this point in the history
  • Loading branch information
kruskall committed Jan 19, 2024
1 parent 27ba8ec commit 3c03c15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions transport/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func ProxyDialer(log *logp.Logger, config *ProxyConfig, forward Dialer) (Dialer,
}

contextDialer, ok := dialer.(Dialer)
// This will never be executed because the proxy package always returns
// a ContextDialer but they didn't break the interface for backward compatibiliy.
// See golang/go#58376
if !ok {
contextDialer = DialerFunc(func(ctx context.Context, network, address string) (net.Conn, error) {
return dialer.Dial(network, address)
Expand Down

0 comments on commit 3c03c15

Please sign in to comment.