mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-11 06:24:04 +00:00
Fix variable shadowing.
This commit is contained in:
+3
-2
@@ -126,9 +126,10 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
if len(filesToDelete) > 0 {
|
if len(filesToDelete) > 0 {
|
||||||
context.Progress().InitBar(int64(len(filesToDelete)), false)
|
context.Progress().InitBar(int64(len(filesToDelete)), false)
|
||||||
totalSize := int64(0)
|
|
||||||
|
var size, totalSize int64
|
||||||
for _, file := range filesToDelete {
|
for _, file := range filesToDelete {
|
||||||
size, err := context.PackagePool().Remove(file)
|
size, err = context.PackagePool().Remove(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if cmd.Name() == "snapshot" {
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to publish: %s", err)
|
return fmt.Errorf("unable to publish: %s", err)
|
||||||
}
|
}
|
||||||
@@ -44,7 +45,8 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
|
|||||||
source = snapshot
|
source = snapshot
|
||||||
message = fmt.Sprintf("Snapshot %s", snapshot.Name)
|
message = fmt.Sprintf("Snapshot %s", snapshot.Name)
|
||||||
} else if cmd.Name() == "repo" {
|
} 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 {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to publish: %s", err)
|
return fmt.Errorf("unable to publish: %s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user