Fixes #31859
Change-Id: I228ed93f9466d1a22f8796964f5d2f056ab9b62f
Reviewed-on: https://go-review.googlesource.com/c/go/+/186818
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Caleb Spare <cespare@gmail.com>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
</p>
<p><!-- CL 173722 -->
- Testing flags are now registered in the new <a href="/pkg/testing/#Init"><code>Init</code></a> function.
- As a result, testing flags are now only registered when running a test binary.
+ Testing flags are now registered in the new <a href="/pkg/testing/#Init"><code>Init</code></a> function,
+ which is invoked by the generated <code>main</code> function for the test.
+ As a result, testing flags are now only registered when running a test binary,
+ and packages that call <code>flag.Parse</code> during package initialization may cause tests to fail.
</p>
</dl><!-- testing -->