Add error handling for ForEach's.

This commit is contained in:
Andrey Smirnov
2013-12-26 16:58:04 +04:00
parent be7a1762ac
commit 218057ea48
9 changed files with 151 additions and 40 deletions
+2 -1
View File
@@ -18,8 +18,9 @@ func aptlyMirrorList(cmd *commander.Command, args []string) error {
fmt.Printf("List of mirrors:\n")
repoCollection := debian.NewRemoteRepoCollection(context.database)
repoCollection.ForEach(func(repo *debian.RemoteRepo) {
repoCollection.ForEach(func(repo *debian.RemoteRepo) error {
fmt.Printf(" * %s\n", repo)
return nil
})
fmt.Printf("\nTo get more information about repository, run `aptly mirror show <name>`.\n")