DefaultRepo retrieve the default repository
()
| 49 | |
| 50 | // DefaultRepo retrieve the default repository |
| 51 | func (c *MultiRepoCache) DefaultRepo() (*RepoCache, error) { |
| 52 | if len(c.repos) != 1 { |
| 53 | return nil, fmt.Errorf("repository is not unique") |
| 54 | } |
| 55 | |
| 56 | for _, r := range c.repos { |
| 57 | return r, nil |
| 58 | } |
| 59 | |
| 60 | panic("unreachable") |
| 61 | } |
| 62 | |
| 63 | // ResolveRepo retrieve a repository by name |
| 64 | func (c *MultiRepoCache) ResolveRepo(name string) (*RepoCache, error) { |
no test coverage detected