Fix some variable shadowing.

This commit is contained in:
Andrey Smirnov
2015-01-07 16:11:13 +03:00
parent 87fbd5201b
commit 6e32e3dcf4
2 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -259,7 +259,9 @@ func apiReposPackagesAddDelete(c *gin.Context, cb func(list *deb.PackageList, p
// verify package refs and build package list
for _, ref := range b.PackageRefs {
p, err := context.CollectionFactory().PackageCollection().ByKey([]byte(ref))
var p *deb.Package
p, err = context.CollectionFactory().PackageCollection().ByKey([]byte(ref))
if err != nil {
if err == database.ErrNotFound {
c.Fail(404, fmt.Errorf("package %s: %s", ref, err))