New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: build is slow to report misspelled package name #26874
Comments
What has changed that caused it? |
@oryanmoshe yes, module semantics have made this slow. On my machine (Go 1.10) it takes about 10ms if I misspell the name. |
@cespare I'll look at it and see if I can spot why it's taking so long. |
That's especially odd since, at least according to my understanding, patterns starting with |
@alandonovan, are you seeing this slowness for all builds, or only those with modules enabled? |
The reason is clear from the output: it tries to do a lookup for a different module that might provide ssadum. We need to avoid that. |
Change https://golang.org/cl/129061 mentions this issue: |
Change https://golang.org/cl/151800 mentions this issue: |
In CL 129061, a check was added for patterns that reference nonexistent local directories. While this prevented unnecessary network lookups (fixing #26874), it caused "go list -e" to exit with an error instead of listing packages with error messages. This change avoids the network lookup and does not exit for these kinds of packages. Errors are still reported by internal/load.LoadImport for packages that don't exist. Fixes #28023 Change-Id: I0a648269e437aed3a95bfb05461a397264f3793f Reviewed-on: https://go-review.googlesource.com/c/151800 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
The go command's support for versioned modules means that
go build
takes 12 seconds to report a typo in a package name.The text was updated successfully, but these errors were encountered: