testing: document that T and B are safe for concurrent calls

Fixes #13108.

Change-Id: I474cc2a3b7ced1c9eb978fc815f9c6bae9fb3ecc
Reviewed-on: https://go-review.googlesource.com/17235
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2015-11-25 16:15:45 -05:00 committed by Brad Fitzpatrick
parent 5dd372bd1e
commit e2071ecd08
2 changed files with 19 additions and 0 deletions

View file

@ -282,6 +282,14 @@ var _ TB = (*B)(nil)
// T is a type passed to Test functions to manage test state and support formatted test logs.
// Logs are accumulated during execution and dumped to standard error when done.
//
// A test ends when its Test function returns or calls any of the methods
// FailNow, Fatal, Fatalf, SkipNow, Skip, or Skipf. Those methods, as well as
// the Parallel method, must be called only from the goroutine running the
// Test function.
//
// The other reporting methods, such as the variations of Log and Error,
// may be called simultaneously from multiple goroutines.
type T struct {
common
name string // Name of test.