List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser depending on whether user is empty. Deprecated: Use RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser instead. GitHub API docs: https://docs.github.com/rest/repos/repos?apiVe
(ctx context.Context, user string, opts *RepositoryListOptions)
| 290 | //meta:operation GET /user/repos |
| 291 | //meta:operation GET /users/{username}/repos |
| 292 | func (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) { |
| 293 | if opts == nil { |
| 294 | opts = &RepositoryListOptions{} |
| 295 | } |
| 296 | if user != "" { |
| 297 | return s.ListByUser(ctx, user, &RepositoryListByUserOptions{ |
| 298 | Type: opts.Type, |
| 299 | Sort: opts.Sort, |
| 300 | Direction: opts.Direction, |
| 301 | ListOptions: opts.ListOptions, |
| 302 | }) |
| 303 | } |
| 304 | return s.ListByAuthenticatedUser(ctx, &RepositoryListByAuthenticatedUserOptions{ |
| 305 | Visibility: opts.Visibility, |
| 306 | Affiliation: opts.Affiliation, |
| 307 | Type: opts.Type, |
| 308 | Sort: opts.Sort, |
| 309 | Direction: opts.Direction, |
| 310 | ListOptions: opts.ListOptions, |
| 311 | }) |
| 312 | } |
| 313 | |
| 314 | // RepositoryListByUserOptions specifies the optional parameters to the |
| 315 | // RepositoriesService.ListByUser method. |
no test coverage detected