Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201105173854-bc9fc8d8c4bc / refactor / eg / testdata / F1.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/refactor/eg/testdata/F1.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/refactor/eg/testdata/F1.go
new file mode 100644 (file)
index 0000000..2258abd
--- /dev/null
@@ -0,0 +1,48 @@
+// +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.Lock()
+
+       // Match
+       y.Lock()
+
+       // Match indirect
+       z.Lock()
+
+       // 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.Lock()
+
+       // No match
+       b.Lock()
+}