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

Function WithAuthToken

github/github.go:430–439  ·  view source on GitHub ↗

WithAuthToken returns a ClientOptionsFunc that sets the authentication token for a Client. If not set, the client will make unauthenticated requests.

(token string)

Source from the content-addressed store, hash-verified

428// WithAuthToken returns a ClientOptionsFunc that sets the authentication token
429// for a Client. If not set, the client will make unauthenticated requests.
430func WithAuthToken(token string) ClientOptionsFunc {
431 return func(o *clientOptions) error {
432 if token == "" {
433 return errors.New("token must not be empty")
434 }
435
436 o.token = &token
437 return nil
438 }
439}
440
441// WithURLs returns a ClientOptionsFunc that sets the base and upload URLs
442// while only validating the URL format. Nil values will be ignored and default

Callers 15

newClientFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
fetchAllUserMigrationsFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestWithAuthTokenFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…