vulnsrc/alpine: avoid shadowing vars
This commit is contained in:
parent
e907e4d263
commit
4c2be5285e
@ -58,19 +58,20 @@ func (u *updater) Update(db database.Datastore) (resp vulnsrc.UpdateResponse, er
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ask the database for the latest commit we successfully applied.
|
// Open a database transaction.
|
||||||
var dbCommit string
|
|
||||||
tx, err := db.Begin()
|
tx, err := db.Begin()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer tx.Rollback()
|
defer tx.Rollback()
|
||||||
|
|
||||||
dbCommit, ok, err := tx.FindKeyValue(updaterFlag)
|
// Ask the database for the latest commit we successfully applied.
|
||||||
|
var dbCommit string
|
||||||
|
var ok bool
|
||||||
|
dbCommit, ok, err = tx.FindKeyValue(updaterFlag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
dbCommit = ""
|
dbCommit = ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user