Merge pull request #115382 from liggitt/typecheck-stdlib

Avoid typechecking stdlib
This commit is contained in:
Kubernetes Prow Robot 2023-01-29 16:15:00 -08:00 committed by GitHub
commit 97636ed781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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...)
} }
} }