diff --git a/cmd/db_cleanup.go b/cmd/db_cleanup.go index ae08347d..18d1dda7 100644 --- a/cmd/db_cleanup.go +++ b/cmd/db_cleanup.go @@ -126,9 +126,10 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error { if len(filesToDelete) > 0 { context.Progress().InitBar(int64(len(filesToDelete)), false) - totalSize := int64(0) + + var size, totalSize int64 for _, file := range filesToDelete { - size, err := context.PackagePool().Remove(file) + size, err = context.PackagePool().Remove(file) if err != nil { return err } diff --git a/cmd/publish_snapshot.go b/cmd/publish_snapshot.go index 63596d1e..21b34b5a 100644 --- a/cmd/publish_snapshot.go +++ b/cmd/publish_snapshot.go @@ -31,7 +31,8 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error { ) if cmd.Name() == "snapshot" { - snapshot, err := context.CollectionFactory().SnapshotCollection().ByName(name) + var snapshot *deb.Snapshot + snapshot, err = context.CollectionFactory().SnapshotCollection().ByName(name) if err != nil { return fmt.Errorf("unable to publish: %s", err) } @@ -44,7 +45,8 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error { source = snapshot message = fmt.Sprintf("Snapshot %s", snapshot.Name) } else if cmd.Name() == "repo" { - localRepo, err := context.CollectionFactory().LocalRepoCollection().ByName(name) + var localRepo *deb.LocalRepo + localRepo, err = context.CollectionFactory().LocalRepoCollection().ByName(name) if err != nil { return fmt.Errorf("unable to publish: %s", err) }