Avoid typechecking stdlib

This commit is contained in:
Jordan Liggitt 2023-01-28 23:10:45 -05:00
parent 5a2dd64801
commit a5d7f516d4
No known key found for this signature in database

View File

@ -80,7 +80,7 @@ var (
func newConfig(platform string) *packages.Config { func newConfig(platform string) *packages.Config {
platSplit := strings.Split(platform, "/") platSplit := strings.Split(platform, "/")
goos, goarch := platSplit[0], platSplit[1] goos, goarch := platSplit[0], platSplit[1]
mode := packages.NeedName | packages.NeedFiles | packages.NeedTypes | packages.NeedSyntax | packages.NeedDeps | packages.NeedImports mode := packages.NeedName | packages.NeedFiles | packages.NeedTypes | packages.NeedSyntax | packages.NeedDeps | packages.NeedImports | packages.NeedModule
if *defuses { if *defuses {
mode = mode | packages.NeedTypesInfo mode = mode | packages.NeedTypesInfo
} }
@ -204,7 +204,7 @@ func (c *collector) verify(plat string) ([]string, error) {
for _, pkg := range allList { for _, pkg := range allList {
if len(pkg.GoFiles) > 0 { if len(pkg.GoFiles) > 0 {
if len(pkg.Errors) > 0 { if len(pkg.Errors) > 0 && (pkg.PkgPath == "main" || strings.Contains(pkg.PkgPath, ".")) {
errors = append(errors, pkg.Errors...) errors = append(errors, pkg.Errors...)
} }
} }