Skip to content

Commit 8073fd2

Browse files
committed
package lvl PushTester info for goroutines
1 parent c2f1416 commit 8073fd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

assert/doc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
Package assert includes runtime assertion helpers both for normal execution as
33
well as a assertion package for Go's testing. What makes solution unique is its
44
capable to support both modes with the same API. Only thing you need to do is to
5-
add a [PushTester] line at the beginning of your unit tests:
5+
add a [PushTester] line at the beginning of your unit tests and its
6+
sub-gouroutines:
67
78
func TestInvite(t *testing.T) {
89
defer assert.PushTester(t)() // push testing variable t beginning of any test
@@ -12,7 +13,7 @@ add a [PushTester] line at the beginning of your unit tests:
1213
assert.Equal(alice.Len(), 1) // assert anything normally
1314
...
1415
go func() {
15-
defer assert.PushTester(t)() // <-- Needs to do again for new goroutine
16+
assert.PushTester(t) // <-- Needs to do again for a new goroutine
1617
1718
# Merge Runtime And Unit Test Assertions
1819

0 commit comments

Comments
 (0)