testing: add Testing function

The Testing function reports whether the program is a test created
by "go test".

Fixes #52600

Change-Id: Ie0fff7c7dfdfdf997c18b4b6112632600b327cc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/475496
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2023-03-08 16:16:59 -08:00 committed by Gopher Robot
parent e8543a6fa6
commit 7f38067acb
4 changed files with 84 additions and 2 deletions

1
api/next/52600.txt Normal file
View file

@ -0,0 +1 @@
pkg testing, func Testing() bool #52600