main: fix race condition in tests

This caused most tests to run the zeroalloc.go test instead of what they
should have been tested, and in turn explains most of the performance
gains of parallel testing.

This commit fixes it by avoiding race conditions. Luckily, no tests
started failing since then due to this.
Этот коммит содержится в:
Ayke van Laethem 2020-01-14 16:22:20 +01:00 коммит произвёл Ayke
родитель 1a32a68674
коммит 4d5dafd360

Просмотреть файл

@ -72,6 +72,8 @@ func runPlatTests(target string, matches []string, t *testing.T) {
t.Parallel()
for _, path := range matches {
path := path // redefine to avoid race condition
switch {
case target == "wasm":
// testdata/gc.go is known not to work on WebAssembly