goautomock icon indicating copy to clipboard operation
goautomock copied to clipboard

Race condition when using the generated mocks

Open urandom opened this issue 8 years ago • 0 comments

The current mocks produce race conditions when using with goroutines, because of the calls counters.

I suggest changing the template for the mocks to embed a sync.RWMutex and adding locks whenever the calls hash is modified/read.

urandom avatar Sep 01 '17 12:09 urandom