MCPcopy Index your code
hub / github.com/google/go-github / WithHTTPClient

Function WithHTTPClient

github/github.go:367–377  ·  view source on GitHub ↗

WithHTTPClient returns a ClientOptionsFunc that sets the http.Client for a Client. If not set, a default http.Client will be used.

(httpClient *http.Client)

Source from the content-addressed store, hash-verified

365// WithHTTPClient returns a ClientOptionsFunc that sets the http.Client
366// for a Client. If not set, a default http.Client will be used.
367func WithHTTPClient(httpClient *http.Client) ClientOptionsFunc {
368 return func(o *clientOptions) error {
369 if httpClient == nil {
370 return errors.New("http client must not be nil")
371 }
372
373 httpClient := *httpClient
374 o.httpClient = &httpClient
375 return nil
376 }
377}
378
379// WithTransport returns a ClientOptionsFunc that sets the http.RoundTripper
380// for a Client. This overrides the transport set by [WithHTTPClient]. If not

Callers 11

mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
getOAuthAppClientFunction · 0.92
setupFunction · 0.85
TestWithHTTPClientFunction · 0.85
TestNewClientFunction · 0.85
TestClient_CloneFunction · 0.85
TestDo_sanitizeURLFunction · 0.85
TestBasicAuthTransportFunction · 0.85

Calls

no outgoing calls

Tested by 8

getOAuthAppClientFunction · 0.74
setupFunction · 0.68
TestWithHTTPClientFunction · 0.68
TestNewClientFunction · 0.68
TestClient_CloneFunction · 0.68
TestDo_sanitizeURLFunction · 0.68
TestBasicAuthTransportFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…