refactor(ooni): introduce interfaces for testability
This commit is contained in:
parent
c55f67273e
commit
fa803300bb
13 changed files with 129 additions and 70 deletions
|
|
@ -65,11 +65,11 @@ func init() {
|
|||
}
|
||||
|
||||
if *all == true {
|
||||
return deleteAll(ctx.DB, *yes)
|
||||
return deleteAll(ctx.DB(), *yes)
|
||||
}
|
||||
|
||||
if *yes == true {
|
||||
err = database.DeleteResult(ctx.DB, *resultID)
|
||||
err = database.DeleteResult(ctx.DB(), *resultID)
|
||||
if err == db.ErrNoMoreRows {
|
||||
return errors.New("result not found")
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ func init() {
|
|||
if answer == "false" {
|
||||
return errors.New("canceled by user")
|
||||
}
|
||||
err = database.DeleteResult(ctx.DB, *resultID)
|
||||
err = database.DeleteResult(ctx.DB(), *resultID)
|
||||
if err == db.ErrNoMoreRows {
|
||||
return errors.New("result not found")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue