Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/go/packages: go list emits no CompiledGoFiles for packages that depend on one with an error #28755
The TestLoadSyntaxError test case establishes an import graph a->b->c->d->e->f where e contains an error:
If you run tip go list on a and c (as in the test), the reported set of CompiledGoFiles is accurate only for e and f, but not for any package above them, presumably because no build was attempted for those packages:
Eliminating the type error cause go list to report CompiledGoFiles all the way up:
This is arguably a bug in go list, but it suggests we need better test coverage and a more complex and better documented workaround for missing CompiledGoFiles than go/packages has today.