We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7129d9 commit 9b2bdf4Copy full SHA for 9b2bdf4
repos.go
@@ -35,12 +35,18 @@ type RepositoryList []*Repository
35
// Contains check if a repository definition is already contained
36
// in the RepositoryList
37
func (r RepositoryList) Contains(repo *Repository) bool {
38
- for _, i := range r {
39
- if repo.Equals(i) {
40
- return true
+ return r.Find(repo) != nil
+}
+
41
+// Find search a repo in the RepositoryList that has metadata
42
+// matching with the one passed as parameter
43
+func (r RepositoryList) Find(repoToFind *Repository) *Repository {
44
+ for _, repo := range r {
45
+ if repoToFind.Equals(repo) {
46
+ return repo
47
}
48
- return false
49
+ return nil
50
51
52
// Repository is a repository installed in the system
0 commit comments