github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/unused/testdata/src/example.com/nocopy-main/nocopy-main.go (about) 1 package main 2 3 type myNoCopy1 struct{} //@ used("myNoCopy1", true) 4 type myNoCopy2 struct{} //@ used("myNoCopy2", true) 5 type wrongLocker struct{} //@ used("wrongLocker", false) 6 type someStruct struct { //@ used("someStruct", false) 7 x int //@ quiet("x") 8 } 9 10 func (myNoCopy1) Lock() {} //@ used("Lock", true) 11 func (recv myNoCopy2) Lock() {} //@ used("Lock", true), used("recv", true) 12 func (wrongLocker) lock() {} //@ used("lock", false) 13 func (wrongLocker) unlock() {} //@ used("unlock", false) 14 func (someStruct) Lock() {} //@ used("Lock", false) 15 16 type T struct { //@ used("T", true) 17 noCopy1 myNoCopy1 //@ used("noCopy1", true) 18 noCopy2 myNoCopy2 //@ used("noCopy2", true) 19 field1 someStruct //@ used("field1", false) 20 field2 wrongLocker //@ used("field2", false) 21 field3 int //@ used("field3", false) 22 } 23 24 func main() { //@ used("main", true) 25 _ = T{} 26 }