mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Comment on shadowing variable.
This commit is contained in:
parent
0c3cbfc2e6
commit
dfa40af993
@ -28,6 +28,10 @@ func TestAccOrganizationPolicy(t *testing.T) {
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
// shadow the tc variable into scope so that when
|
||||
// the loop continues, if t.Run hasn't executed tc(t)
|
||||
// yet, we don't have a race condition
|
||||
// see https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
|
||||
tc := tc
|
||||
t.Run(name, func(t *testing.T) {
|
||||
tc(t)
|
||||
|
Loading…
Reference in New Issue
Block a user