Filter remotes by given hostnames, maintains original order
(hosts []string)
| 36 | |
| 37 | // Filter remotes by given hostnames, maintains original order |
| 38 | func (r Remotes) FilterByHosts(hosts []string) Remotes { |
| 39 | filtered := make(Remotes, 0) |
| 40 | for _, rr := range r { |
| 41 | for _, host := range hosts { |
| 42 | if strings.EqualFold(rr.RepoHost(), host) { |
| 43 | filtered = append(filtered, rr) |
| 44 | break |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | return filtered |
| 49 | } |
| 50 | |
| 51 | func (r Remotes) ResolvedRemote() (*Remote, error) { |
| 52 | for _, rr := range r { |