blob: afc96cc1ef358e2733c4c7983aa6dbe10b04fcb6 [file] [log] [blame]
This test checks that formatting does not run on code that has parse errors.
-- parse.go --
package noparse_format //@format(parse)
func _() {
f() //@diag("f", re"(undefined|undeclared name): f")
}
-- @parse --
package noparse_format //@format(parse)
func _() {
f() //@diag("f", re"(undefined|undeclared name): f")
}
-- noparse.go --
package noparse_format //@format(noparse)
// The nonewvars expectation asserts that the go/analysis framework ran.
func what() {
var hi func()
if { hi() //@diag(re"(){", re".*missing.*")
}
hi := nil
}
-- @noparse --
7:5: missing condition in if statement