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

Function addOptions

github/github.go:323–340  ·  view source on GitHub ↗

addOptions adds the parameters in opts as URL query parameters to s. opts must be a struct whose fields may contain "url" tags.

(s string, opts P)

Source from the content-addressed store, hash-verified

321// addOptions adds the parameters in opts as URL query parameters to s. opts
322// must be a struct whose fields may contain "url" tags.
323func addOptions[P structPtr[T], T any](s string, opts P) (string, error) {
324 if opts == nil {
325 return s, nil
326 }
327
328 u, err := url.Parse(s)
329 if err != nil {
330 return s, err
331 }
332
333 qs, err := query.Values(opts)
334 if err != nil {
335 return s, err
336 }
337
338 u.RawQuery = qs.Encode()
339 return u.String(), nil
340}
341
342// errUninitialized is returned when an uninitialized Client is used.
343var errUninitialized = errors.New("client is not initialized")

Callers 15

ListUserMigrationsMethod · 0.85
ListRulesForBranchMethod · 0.85
GetAllRulesetsMethod · 0.85
ListIssueTimelineMethod · 0.85
ListByUserMethod · 0.85
ListByOrgMethod · 0.85
ListAllMethod · 0.85
ListContributorsMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…