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

Function WithURLs

github/github.go:444–466  ·  view source on GitHub ↗

WithURLs returns a ClientOptionsFunc that sets the base and upload URLs while only validating the URL format. Nil values will be ignored and default URLs will be used.

(baseURL, uploadURL *string)

Source from the content-addressed store, hash-verified

442// while only validating the URL format. Nil values will be ignored and default
443// URLs will be used.
444func WithURLs(baseURL, uploadURL *string) ClientOptionsFunc {
445 return func(o *clientOptions) error {
446 if baseURL != nil {
447 b, err := parseURL(*baseURL)
448 if err != nil {
449 return fmt.Errorf("invalid base url: %w", err)
450 }
451
452 o.baseURL = b
453 }
454
455 if uploadURL != nil {
456 u, err := parseURL(*uploadURL)
457 if err != nil {
458 return fmt.Errorf("invalid upload url: %w", err)
459 }
460
461 o.uploadURL = u
462 }
463
464 return nil
465 }
466}
467
468// WithEnterpriseURLs returns a ClientOptionsFunc that sets the base and upload
469// URLs for a Client.

Callers 2

TestWithURLsFunction · 0.85

Calls 1

parseURLFunction · 0.85

Tested by 2

TestWithURLsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…