ForEach method for repositories.

This commit is contained in:
Andrey Smirnov committed 2013-12-19 17:34:13 +04:00
1 parent ed6265da10
commit 8e08b09aca
2 files changed
+16

No files matched your search

+7
View File
@@ -267,3 +267,10 @@ func (collection *RemoteRepoCollection) ByName(name string) (*RemoteRepo, error)
}
return nil, fmt.Errorf("mirror with name %s not found", name)
}
// ForEach runs method for each repository
func (collection *RemoteRepoCollection) ForEach(handler func(*RemoteRepo)) {
for _, r := range collection.list {
handler(r)
}
}