h2non / gock

HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽

Home Page:https://pkg.go.dev/github.com/h2non/gock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Race condition in mock.go file

Halfi opened this issue · comments

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.