Skip to content

Commit

Permalink
use RWMutex
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei authored and boyan-soubachov committed May 4, 2022
1 parent a409ccf commit 106ec21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ var matchMethod = flag.String("testify.m", "", "regular expression to select tes
// retrieving the current *testing.T context.
type Suite struct {
*assert.Assertions
mu sync.Mutex
mu sync.RWMutex
require *require.Assertions
t *testing.T
}

// T retrieves the current *testing.T context.
func (suite *Suite) T() *testing.T {
suite.mu.Lock()
defer suite.mu.Unlock()
suite.mu.RLock()
defer suite.mu.RUnlock()
return suite.t
}

Expand Down

0 comments on commit 106ec21

Please sign in to comment.