The test wants to check that copies of Cond are detected at runtime.
Make a copy that isn't detected by vet at compile time.
Change-Id: I933ab1003585f75ba96723563107f1ba8126cb72
Reviewed-on: https://go-review.googlesource.com/108557
Reviewed-by: Ian Lance Taylor <iant@golang.org>
package sync_test
import (
- . "sync"
-
+ "reflect"
"runtime"
+ . "sync"
"testing"
"time"
)
}()
c := Cond{L: &Mutex{}}
c.Signal()
- c2 := c
+ var c2 Cond
+ reflect.ValueOf(&c2).Elem().Set(reflect.ValueOf(&c).Elem()) // c2 := c, hidden from vet
c2.Signal()
}