Skip to content

Commit

Permalink
Merge pull request #1392 from programmer04/improve-docs
Browse files Browse the repository at this point in the history
Document that require is not safe to call in created goroutines
  • Loading branch information
dolmen committed Jul 5, 2023
2 parents 68bbf7a + e18a70d commit 945f91b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -104,6 +104,8 @@ func TestSomething(t *testing.T) {
---------------------------------------------------------------------------------------------

The `require` package provides same global functions as the `assert` package, but instead of returning a boolean result they terminate current test.
These functions must be called from the goroutine running the test or benchmark function, not from other goroutines created during the test.
Otherwise race conditions may occur.

See [t.FailNow](http://golang.org/pkg/testing/#T.FailNow) for details.

Expand Down

0 comments on commit 945f91b

Please sign in to comment.