Skip to content

Conversation

@gheinrich-dd
Copy link

Motivation

There's currently a data race as described here. This makes it hard to enable data race detection for projects using this package. I'm implementing a possible solution using the atomic.Bool wrapper and enabling race detection via -race for go tests. I also had to wrap appending to the slice in a unit test with a lock to fix another data race issue. One caveat of this solution is that using atomic.Bool requires a minimum go version of 1.19.

@gheinrich-dd
Copy link
Author

If bumping to go 1.19 is not desired, I could also change it to wrap access to the shared variable with sync.Mutex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant