]> Cypherpunks repositories - gostls13.git/commitdiff
testing: add doc to not call Init concurrently
authorgo101 <tapir.liu@gmail.com>
Tue, 5 Sep 2023 03:53:29 +0000 (03:53 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 5 Sep 2023 22:26:12 +0000 (22:26 +0000)
Change-Id: I2e218805fbe4858be125df97bdaf921799315799
GitHub-Last-Rev: 32b798d75f7ec0f72e18a65932ad93d8e5f1040a
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>
src/testing/testing.go

index fcf7048f23404db6d21835c8e17da539f912556d..1bc8aff00d1085a78d9175bdb3fa502e81e08fdb 100644 (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