-
Alberto Bertogli authored
Calling flag.Parse twice can be problematic if other goroutines called flag.Parsed in between: the race detector complains due to the write after read from a different goroutine. This can happen if TestMain calls flag.Parse and launches goroutines that call flag.Parsed, for example if it initializes a server which checks flags. This patch makes testing.M.Run only parse the flags if they have not been parsed already. Change-Id: Id9f8c31c5f90614e3f34c63d1a32cf7e9055d68e Reviewed-on: https://go-review.googlesource.com/16739Reviewed-by: Russ Cox <rsc@golang.org>
ab196aef
Name |
Last commit
|
Last update |
---|---|---|
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
LICENSE | ||
PATENTS | ||
README.md | ||
favicon.ico | ||
robots.txt |