diff --git a/src/test-table.md b/src/test-table.md index eafbf3c..65fd2c5 100644 --- a/src/test-table.md +++ b/src/test-table.md @@ -236,33 +236,4 @@ While there are no strict guidelines, readability and maintainability should always be top-of-mind when deciding between Table Tests versus separate tests for multiple inputs/outputs to a system. -## Parallel Tests - -Parallel tests, like some specialized loops (for example, those that spawn -goroutines or capture references as part of the loop body), -must take care to explicitly assign loop variables within the loop's scope to -ensure that they hold the expected values. - -```go -tests := []struct{ - give string - // ... -}{ - // ... -} - -for _, tt := range tests { - tt := tt // for t.Parallel - t.Run(tt.give, func(t *testing.T) { - t.Parallel() - // ... - }) -} -``` - -In the example above, we must declare a `tt` variable scoped to the loop -iteration because of the use of `t.Parallel()` below. -If we do not do that, most or all tests will receive an unexpected value for -`tt`, or a value that changes as they're running. - diff --git a/style.md b/style.md index bf0d20b..ca5d2cc 100644 --- a/style.md +++ b/style.md @@ -3896,35 +3896,6 @@ While there are no strict guidelines, readability and maintainability should always be top-of-mind when deciding between Table Tests versus separate tests for multiple inputs/outputs to a system. -#### Parallel Tests - -Parallel tests, like some specialized loops (for example, those that spawn -goroutines or capture references as part of the loop body), -must take care to explicitly assign loop variables within the loop's scope to -ensure that they hold the expected values. - -```go -tests := []struct{ - give string - // ... -}{ - // ... -} - -for _, tt := range tests { - tt := tt // for t.Parallel - t.Run(tt.give, func(t *testing.T) { - t.Parallel() - // ... - }) -} -``` - -In the example above, we must declare a `tt` variable scoped to the loop -iteration because of the use of `t.Parallel()` below. -If we do not do that, most or all tests will receive an unexpected value for -`tt`, or a value that changes as they're running. - ### Functional Options