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

Function WithTransport

github/github.go:382–391  ·  view source on GitHub ↗

WithTransport returns a ClientOptionsFunc that sets the http.RoundTripper for a Client. This overrides the transport set by [WithHTTPClient]. If not set and no HTTP client is provided, the default http.RoundTripper will be used.

(transport http.RoundTripper)

Source from the content-addressed store, hash-verified

380// for a Client. This overrides the transport set by [WithHTTPClient]. If not
381// set and no HTTP client is provided, the default http.RoundTripper will be used.
382func WithTransport(transport http.RoundTripper) ClientOptionsFunc {
383 return func(o *clientOptions) error {
384 if transport == nil {
385 return errors.New("transport must not be nil")
386 }
387
388 o.transport = transport
389 return nil
390 }
391}
392
393// WithTimeout returns a ClientOptionsFunc that sets the timeout for a Client.
394// This overrides the timeout set by [WithHTTPClient]. If not set and no HTTP

Callers 5

mainFunction · 0.92
TestWithTransportFunction · 0.85
TestClient_CloneFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestWithTransportFunction · 0.68
TestClient_CloneFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…