Since go1.21, (*go/types.Checker).Files() has returned an error when a package has a GoVersion (specified in types.Config.GoVersion) that is newer than the go/types library it is compiled against. Error in question is:
if check.version.after(version{1, goversion.Version}) {
return fmt.Errorf("package requires newer Go version %v", check.version)
}
x/tools/go/packages was assuming the only error not reported to types.Config.Error was types.errBadCgo. Example downstream issue: #65590.
This issue is to decide whether this error should be reported to the types.Config.Error field, and if so how?
@griesemer @adonovan
Since go1.21,
(*go/types.Checker).Files()has returned an error when a package has aGoVersion(specified intypes.Config.GoVersion) that is newer than thego/typeslibrary it is compiled against. Error in question is:x/tools/go/packageswas assuming the onlyerrornot reported totypes.Config.Errorwastypes.errBadCgo. Example downstream issue: #65590.This issue is to decide whether this error should be reported to the
types.Config.Errorfield, and if so how?@griesemer @adonovan