FindByRepo returns the first Remote that points to a specific GitHub repository
(owner, name string)
| 26 | |
| 27 | // FindByRepo returns the first Remote that points to a specific GitHub repository |
| 28 | func (r Remotes) FindByRepo(owner, name string) (*Remote, error) { |
| 29 | for _, rem := range r { |
| 30 | if strings.EqualFold(rem.RepoOwner(), owner) && strings.EqualFold(rem.RepoName(), name) { |
| 31 | return rem, nil |
| 32 | } |
| 33 | } |
| 34 | return nil, fmt.Errorf("no matching remote found; looking for %s/%s", owner, name) |
| 35 | } |
| 36 | |
| 37 | // Filter remotes by given hostnames, maintains original order |
| 38 | func (r Remotes) FilterByHosts(hosts []string) Remotes { |