x/tools/go/packages: loader doesn't handle/recognize "context canceled" error #37115
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I used packages.Load function with Config.Context set. If context canceled and packages.loader in loadPackage function, appendError prints "internal error" message
https://github.com/golang/tools/blob/master/go/packages/packages.go#L791
To reproduce error, we can inject delay in loader.loadRecursive/loadPackage function and
modify testParseFileModifyAST, set context to config, which will be canceled before delay in loader.
https://github.com/golang/tools/blob/master/go/packages/packages_test.go#L870
What did you expect to see?
no error messages in stdout
What did you see instead?
..... many lines of ...
2020/02/07 16:18:23 internal error: error "context canceled" (*errors.errorString) without position
.....
The text was updated successfully, but these errors were encountered: