github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/test/testdata/ifshort.go (about)

     1  //go:build !windows
     2  
     3  //golangcitest:args -Eifshort --internal-cmd-test
     4  package testdata
     5  
     6  func DontUseShortSyntaxWhenPossible() {
     7  	getValue := func() interface{} { return nil }
     8  
     9  	v := getValue() // want "variable 'v' is only used in the if-statement .*"
    10  	if v != nil {
    11  		return
    12  	}
    13  }