You've already forked go-sqlxmock
mirror of
https://github.com/zhashkevych/go-sqlxmock.git
synced 2025-06-12 21:47:29 +02:00
adds missing lock around e.fulfilled() in ExpectationsWereMet()
This commit is contained in:
@ -166,7 +166,11 @@ func (c *sqlmock) Close() error {
|
||||
|
||||
func (c *sqlmock) ExpectationsWereMet() error {
|
||||
for _, e := range c.expected {
|
||||
if !e.fulfilled() {
|
||||
e.Lock()
|
||||
fulfilled := e.fulfilled()
|
||||
e.Unlock()
|
||||
|
||||
if !fulfilled {
|
||||
return fmt.Errorf("there is a remaining expectation which was not matched: %s", e)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user