diff --git a/db/query.go b/db/query.go index d53c1ce..6129e16 100644 --- a/db/query.go +++ b/db/query.go @@ -63,15 +63,21 @@ func (that *HoTimeDB) queryWithRetry(query string, retried bool, args ...interfa processedArgs := that.processArgs(args) if that.testTx != nil { - if that.testMu != nil { that.testMu.Lock() } + if that.testMu != nil { + that.testMu.Lock() + } resl, err = that.testTx.Query(query, processedArgs...) that.LastErr.SetError(err) if err != nil { - if that.testMu != nil { that.testMu.Unlock() } + if that.testMu != nil { + that.testMu.Unlock() + } return nil } result := that.Row(resl) - if that.testMu != nil { that.testMu.Unlock() } + if that.testMu != nil { + that.testMu.Unlock() + } return result } else if that.Tx != nil { resl, err = that.Tx.Query(query, processedArgs...) @@ -129,9 +135,13 @@ func (that *HoTimeDB) execWithRetry(query string, retried bool, args ...interfac processedArgs := that.processArgs(args) if that.testTx != nil { - if that.testMu != nil { that.testMu.Lock() } + if that.testMu != nil { + that.testMu.Lock() + } resl, e = that.testTx.Exec(query, processedArgs...) - if that.testMu != nil { that.testMu.Unlock() } + if that.testMu != nil { + that.testMu.Unlock() + } } else if that.Tx != nil { resl, e = that.Tx.Exec(query, processedArgs...) } else {