diff --git a/go/loader/loader_test.go b/go/loader/loader_test.go index 5fa3254674..e68405ad0c 100644 --- a/go/loader/loader_test.go +++ b/go/loader/loader_test.go @@ -645,8 +645,11 @@ func TestErrorReporting(t *testing.T) { for pkg, info := range prog.AllPackages { switch pkg.Path() { case "a": - if !hasError(info.Errors, "cannot convert false") { - t.Errorf("a.Errors = %v, want bool conversion (type) error", info.Errors) + // The match below is unfortunately vague, because in go1.16 the error + // message in go/types changed from "cannot convert ..." to "cannot use + // ... as ... in assignment". + if !hasError(info.Errors, "cannot") { + t.Errorf("a.Errors = %v, want bool assignment (type) error", info.Errors) } if !hasError(info.Errors, "could not import c") { t.Errorf("a.Errors = %v, want import (loader) error", info.Errors) @@ -659,7 +662,7 @@ func TestErrorReporting(t *testing.T) { } // Check errors reported via error handler. - if !hasError(allErrors, "cannot convert false") || + if !hasError(allErrors, "cannot") || !hasError(allErrors, "rune literal not terminated") || !hasError(allErrors, "could not import c") { t.Errorf("allErrors = %v, want syntax, type and loader errors", allErrors)