Skip to content

Commit

Permalink
Clarify WithProxy behavior with nil (#64)
Browse files Browse the repository at this point in the history
It looks like by accident the comment specifies that specifying a `nil`
`proxyFunc` will both force no proxy at all _and_ fallback to
`http.ProxyFromEnvironment`. Only one of those things can be true, and
it's the latter. Remove obsolete comment.
  • Loading branch information
jchadwick-buf committed Apr 19, 2024
1 parent 47d0968 commit 0748894
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,9 @@ func WithHealthChecks(checker health.Checker) ClientOption {
// The given proxyFunc returns the URL of a proxy server to use for the
// given HTTP request. If no proxy should be used, it should return nil, nil.
// If an error is returned, the request fails immediately with that error.
// If a nil proxyFunc is provided, no proxy will ever be used. This can be
// useful to disable proxies. If this function is set to nil or no
// WithProxy option is provided, [http.ProxyFromEnvironment] will be used
// as the proxyFunc. (Also see WithNoProxy.)
// If this function is set to nil or no WithProxy option is provided,
// [http.ProxyFromEnvironment] will be used as the proxyFunc. (Also see
// WithNoProxy.)
//
// The given onProxyConnectFunc, if non-nil, provides a way to examine the
// response from the proxy for a CONNECT request. If the onProxyConnectFunc
Expand Down

0 comments on commit 0748894

Please sign in to comment.