github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/staticcheck/testdata/src/CheckUnreadVariableValues/CheckUnreadVariableValues_test.go (about)

     1  package pkg
     2  
     3  import "testing"
     4  
     5  func fn() int { println(); return 0 }
     6  
     7  func TestFoo(t *testing.T) {
     8  	x := fn() // MATCH "never used"
     9  	x = fn()
    10  	println(x)
    11  }
    12  
    13  func ExampleFoo() {
    14  	x := fn()
    15  	x = fn()
    16  	println(x)
    17  }