mirror of
https://github.com/golang/go
synced 2024-11-18 09:24:54 -07:00
802ec582a3
Change-Id: Id3c5b2480c8499ab712265a421ffba125fb913db Reviewed-on: https://go-review.googlesource.com/1401 Reviewed-by: David Symonds <dsymonds@golang.org>
49 lines
579 B
Plaintext
49 lines
579 B
Plaintext
// +build ignore
|
|
|
|
package F1
|
|
|
|
import "sync"
|
|
|
|
func example(n int) {
|
|
var x struct {
|
|
mutex sync.RWMutex
|
|
}
|
|
|
|
var y struct {
|
|
sync.RWMutex
|
|
}
|
|
|
|
type l struct {
|
|
sync.RWMutex
|
|
}
|
|
|
|
var z struct {
|
|
l
|
|
}
|
|
|
|
var a struct {
|
|
*l
|
|
}
|
|
|
|
var b struct{ Lock func() }
|
|
|
|
// Match
|
|
x.mutex.RLock()
|
|
|
|
// Match
|
|
y.RLock()
|
|
|
|
// Match indirect
|
|
z.RLock()
|
|
|
|
// Should be no match however currently matches due to:
|
|
// https://golang.org/issue/8584
|
|
// Will start failing when this is fixed then just change golden to
|
|
// No match pointer indirect
|
|
// a.Lock()
|
|
a.RLock()
|
|
|
|
// No match
|
|
b.Lock()
|
|
}
|