Skip to content

Instantly share code, notes, and snippets.

@teivah
Created November 13, 2019 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teivah/40713ffa0f46e1a6673238601f22aa10 to your computer and use it in GitHub Desktop.
Save teivah/40713ffa0f46e1a6673238601f22aa10 to your computer and use it in GitHub Desktop.
var seqMutex sync.Mutex
func seq() func() {
seqMutex.Lock()
return func() {
seqMutex.Unlock()
}
}
func TestFoo(t *testing.T) {
defer seq()()
// Something
}
func TestBar(t *testing.T) {
defer seq()()
// Something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment