h2non / gock

HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
https://pkg.go.dev/github.com/h2non/gock
MIT License
2.09k stars 107 forks source link

Race condition in mock.go file #91

Closed Halfi closed 3 years ago

Halfi commented 3 years ago

Hello! In rare case it could produce race condition with disabled field in Mocker struct.

It could case when decrement() (https://github.com/h2non/gock/blob/v1.1.1/mock.go#L144) and Disabled() (https://github.com/h2non/gock/blob/v1.1.1/mock.go#L67) called in same time.