Skip to content

Commit

Permalink
vulnsrc/alpine: avoid shadowing vars
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Jul 5, 2018
1 parent e907e4d commit 4c2be52
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ext/vulnsrc/alpine/alpine.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,20 @@ func (u *updater) Update(db database.Datastore) (resp vulnsrc.UpdateResponse, er
return
}

// Ask the database for the latest commit we successfully applied.
var dbCommit string
// Open a database transaction.
tx, err := db.Begin()
if err != nil {
return
}
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 {
return
}

if !ok {
dbCommit = ""
}
Expand Down

0 comments on commit 4c2be52

Please sign in to comment.