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

Method ListUserProjects

github/projects.go:328–346  ·  view source on GitHub ↗

ListUserProjects lists Projects V2 for a user. GitHub API docs: https://docs.github.com/rest/projects/projects?apiVersion=2022-11-28#list-projects-for-user meta:operation GET /users/{username}/projectsV2

(ctx context.Context, username string, opts *ListProjectsOptions)

Source from the content-addressed store, hash-verified

326//
327//meta:operation GET /users/{username}/projectsV2
328func (s *ProjectsService) ListUserProjects(ctx context.Context, username string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) {
329 u := fmt.Sprintf("users/%v/projectsV2", username)
330 u, err := addOptions(u, opts)
331 if err != nil {
332 return nil, nil, err
333 }
334 req, err := s.client.NewRequest(ctx, "GET", u, nil)
335 if err != nil {
336 return nil, nil, err
337 }
338
339 var projects []*ProjectV2
340 resp, err := s.client.Do(req, &projects)
341 if err != nil {
342 return nil, resp, err
343 }
344
345 return projects, resp, nil
346}
347
348// GetUserProject gets a Projects V2 project for a user by ID.
349//

Calls 3

addOptionsFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45