Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/packages: correctly handle context canceled
If the context is canceled for packages.Load, the following log message is written numerous times to stderr and returned as a load error per-package: internal error: error "context canceled" (*errors.errorString) without position packages.Load now checks if the context was canceled while parsing files and returns nil, ctx.Err() if so. parseFiles now will not create unnecessary goroutines when ctx is canceled. ld.Config.Context is equivalent to ld.Context as Config is an embedded struct within loader. Use ld.Context to refer to ld.Config.Context for consistency.
- Loading branch information
Showing
1 changed file
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters