Skip to content

Commit 106ec21

Browse files
hawkingreiboyan-soubachov
authored andcommitted
use RWMutex
Signed-off-by: Weizhen Wang <[email protected]>
1 parent a409ccf commit 106ec21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

suite/suite.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ var matchMethod = flag.String("testify.m", "", "regular expression to select tes
2222
// retrieving the current *testing.T context.
2323
type Suite struct {
2424
*assert.Assertions
25-
mu sync.Mutex
25+
mu sync.RWMutex
2626
require *require.Assertions
2727
t *testing.T
2828
}
2929

3030
// T retrieves the current *testing.T context.
3131
func (suite *Suite) T() *testing.T {
32-
suite.mu.Lock()
33-
defer suite.mu.Unlock()
32+
suite.mu.RLock()
33+
defer suite.mu.RUnlock()
3434
return suite.t
3535
}
3636

0 commit comments

Comments
 (0)