Commit eca7a134 authored by Russ Cox's avatar Russ Cox

sync: hide test of misuse of Cond from vet

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/108557Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 09d36a81
......@@ -4,9 +4,9 @@
package sync_test
import (
. "sync"
"reflect"
"runtime"
. "sync"
"testing"
"time"
)
......@@ -251,7 +251,8 @@ func TestCondCopy(t *testing.T) {
}()
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()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment