Refactoring: use CollectionFactory instead of manual collection creation.

This commit is contained in:
Andrey Smirnov
2014-03-25 14:59:26 +04:00
parent a0497058ee
commit 1a60ac6aa0
24 changed files with 101 additions and 165 deletions
+1 -4
View File
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/gonuts/commander"
"github.com/gonuts/flag"
"github.com/smira/aptly/debian"
)
func aptlyPublishDrop(cmd *commander.Command, args []string) error {
@@ -21,9 +20,7 @@ func aptlyPublishDrop(cmd *commander.Command, args []string) error {
prefix = args[1]
}
publishedCollecton := debian.NewPublishedRepoCollection(context.database)
err = publishedCollecton.Remove(context.publishedStorage, prefix, distribution)
err = context.collectionFactory.PublishedRepoCollection().Remove(context.publishedStorage, prefix, distribution)
if err != nil {
return fmt.Errorf("unable to remove: %s", err)
}