github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/unused/testdata/src/nocopy-main/nocopy-main.go (about) 1 package main 2 3 type myNoCopy1 struct{} 4 type myNoCopy2 struct{} 5 type locker struct{} // MATCH "locker is unused" 6 type someStruct struct{ x int } // MATCH "someStruct is unused" 7 8 func (myNoCopy1) Lock() {} 9 func (recv myNoCopy2) Lock() {} 10 func (locker) Lock() {} 11 func (locker) Unlock() {} 12 func (someStruct) Lock() {} 13 14 type T struct { 15 noCopy1 myNoCopy1 16 noCopy2 myNoCopy2 17 field1 someStruct // MATCH "field1 is unused" 18 field2 locker // MATCH "field2 is unused" 19 field3 int // MATCH "field3 is unused" 20 } 21 22 func main() { 23 _ = T{} 24 }