github.com/v2fly/tools@v0.100.0/internal/lsp/testdata/undeclared/var.go (about)

     1  package undeclared
     2  
     3  func m() int {
     4  	z, _ := 1+y, 11 //@diag("y", "compiler", "undeclared name: y", "error"),suggestedfix("y", "quickfix")
     5  	if 100 < 90 {
     6  		z = 1
     7  	} else if 100 > n+2 { //@diag("n", "compiler", "undeclared name: n", "error"),suggestedfix("n", "quickfix")
     8  		z = 4
     9  	}
    10  	for i < 200 { //@diag("i", "compiler", "undeclared name: i", "error"),suggestedfix("i", "quickfix")
    11  	}
    12  	r() //@diag("r", "compiler", "undeclared name: r", "error")
    13  	return z
    14  }