1
0
mirror of https://github.com/golang/go synced 2024-10-01 03:18:33 -06:00

testing: add doc to not call Init concurrently

Change-Id: I2e218805fbe4858be125df97bdaf921799315799
GitHub-Last-Rev: 32b798d75f
GitHub-Pull-Request: golang/go#62410
Reviewed-on: https://go-review.googlesource.com/c/go/+/525015
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
go101 2023-09-05 03:53:29 +00:00 committed by Gopher Robot
parent b6372114b2
commit 972cc3e7c2

View File

@ -398,7 +398,7 @@ var initRan bool
// the "go test" command before running test functions, so Init is only needed
// when calling functions such as Benchmark without using "go test".
//
// Init has no effect if it was already called.
// Init is not safe to call concurrently. It has no effect if it was already called.
func Init() {
if initRan {
return