tools/go/packages
Bryan C. Mills 84988e2dba go/packages: do not error out for patterns that match no packages
The documentation for Load says:
“Load returns an error if any of the patterns was invalid as defined
by the underlying build system. It may return an empty list of
packages without an error, for instance for an empty expansion of a
valid wildcard. Errors associated with a particular package are
recorded in the corresponding Package's Errors list, and do not cause
Load to return an error.”

Therefore, it should not be an error for a pattern to match no
packages. If the pattern is a literal package path that does not
exist, we should prefer to return a *Package for it with an error in
the Errors field.

Change-Id: Iaecfb920097e3b520e763bd52c0e326d2e7a4861
Reviewed-on: https://go-review.googlesource.com/137075
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2018-09-28 12:33:17 +00:00
..
gopackages go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
doc.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
example_test.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
external.go go/packages: do not error out for patterns that match no packages 2018-09-28 12:33:17 +00:00
golist.go go/packages: do not error out for patterns that match no packages 2018-09-28 12:33:17 +00:00
golist_fallback.go go/packages: add missing test variants to fallback loader 2018-09-25 16:56:39 +00:00
golist_fallback_testmain.go go/packages: add missing test variants to fallback loader 2018-09-25 16:56:39 +00:00
packages.go go/packages: do not error out for patterns that match no packages 2018-09-28 12:33:17 +00:00
packages110_test.go go/packages: generate test main files from the golist fallback 2018-09-17 22:19:12 +00:00
packages_test.go go/packages: do not error out for patterns that match no packages 2018-09-28 12:33:17 +00:00
stdlib_test.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00
visit.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00