| // Copyright 2019 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Issue 31419: race in getitab when two goroutines try |
| // to do the same failed interface conversion. |
| _, ok = e.(I) // populate itab cache with a false result |
| go f() // get itab in a loop |
| for k := 0; k < 10000; k++ { |
| i, ok = e.(I) // read the cached itab |
| println("iteration", k, "i =", i, "&t =", &t) |
| panic("conversion succeeded") |
| for i := 0; i < 10000; i++ { |
| i := e.(I) // triggers itab.init, for getting the panic string |