Major refactoring: access to context happens in methods. #13

This commit is contained in:
Andrey Smirnov
2014-04-05 16:10:51 +04:00
parent 400d0da7d4
commit 2c3553ef0b
31 changed files with 333 additions and 265 deletions
+3 -3
View File
@@ -14,13 +14,13 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
return err
}
if context.collectionFactory.SnapshotCollection().Len() > 0 {
if context.CollectionFactory().SnapshotCollection().Len() > 0 {
fmt.Printf("List of snapshots:\n")
snapshots := make([]string, context.collectionFactory.SnapshotCollection().Len())
snapshots := make([]string, context.CollectionFactory().SnapshotCollection().Len())
i := 0
context.collectionFactory.SnapshotCollection().ForEach(func(snapshot *debian.Snapshot) error {
context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *debian.Snapshot) error {
snapshots[i] = snapshot.String()
i++
return nil