Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckIneffectiveCopy / CheckIneffectiveCopy.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckIneffectiveCopy/CheckIneffectiveCopy.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckIneffectiveCopy/CheckIneffectiveCopy.go
new file mode 100644 (file)
index 0000000..8057d4e
--- /dev/null
@@ -0,0 +1,14 @@
+package pkg
+
+type T struct{}
+
+func fn1(_ *T) {}
+
+func fn2() {
+       t1 := &T{}
+       fn1(&*t1) // want `will not copy`
+       fn1(*&t1) // want `will not copy`
+
+       _Cvar_something := &T{}
+       fn1(&*_Cvar_something)
+}