github.com/nozzle/golangci-lint@v1.49.0-nz3/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  }