Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Use channels to avoid races in tests #37

Merged
merged 2 commits into from Oct 29, 2021
Merged

Conversation

djmitche
Copy link
Collaborator

Using a mock for time doesn't mean races aren't important. This tries to set a good Example by using channels rather than shared variables for communication between goroutines.

Using a mock for time doesn't mean races aren't important.  This tries
to set a good Example by using channels rather than shared variables for
communication between goroutines.
@djmitche
Copy link
Collaborator Author

Fixes #8.

@djmitche
Copy link
Collaborator Author

@vickenty any chance you could have a look

@djmitche
Copy link
Collaborator Author

Updated to use atomics in the examples.

@djmitche djmitche merged commit 1ae85fe into benbjohnson:master Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants