1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:54:45 -07:00
go/cmd
Alan Donovan da9759ca30 cmd/bundle: fix nil dereference panic
In the loader API, (*Config).Import, like go/build, accepts relative
paths such as ".", but (*Program).Package requires the exact path of a
loaded package.  So, to find the package identified by "." we must
look at the set of packages actually loaded, which in this scenario is
guaranteed to be a singleton.

(This is a definite weakness of the loader API.  In the more general
case where two or more packages are imported, it's tricky to correlate
the calls to Import with the package(s) each call actually loads.)

Fixes golang/go#20751

Change-Id: I925e969c9b4f4d6b6344c16f156b47857436d70a
Reviewed-on: https://go-review.googlesource.com/46414
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2017-06-23 02:24:18 +00:00
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
bundle cmd/bundle: fix nil dereference panic 2017-06-23 02:24:18 +00:00
callgraph x/tools: simplify and format code 2017-02-28 14:15:42 +00:00
compilebench cmd/compilebench: use go command in goroot, not environment 2017-05-09 19:43:46 +00:00
cover cmd/cover: check os.Create error im html output 2017-01-08 00:00:17 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg Revert "refactor/eg: remove vendor prefix from imported packages" 2016-11-30 00:13:03 +00:00
fiximports cmd/godoc, cmd/fiximports: fix or skip failing tests at tip 2016-10-12 15:24:30 +00:00
go-contrib-init tools: handle paths like ~/ or $HOME/. 2017-06-22 02:08:34 +00:00
godex cmd/godex: handle printing of type aliases 2017-01-11 21:17:45 +00:00
godoc cmd/godoc: fix expected test output for Go 1.8 and older 2017-04-26 05:21:38 +00:00
goimports cmd/goimports: update docs to not imply goimports is superset of gofmt 2017-06-13 20:38:26 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename refactor/rename: fail cleanly when attempting to rename cgo files 2017-06-23 01:23:57 +00:00
gotype gotype: fix default importer for Go 1.8. 2017-04-10 16:28:46 +00:00
goyacc cmd/goyacc: remove empty branch 2017-03-15 21:33:42 +00:00
guru cmd/guru: fix and reenable failing test case 2017-04-14 23:25:34 +00:00
heapview cmd/heapview: look for tools repository in all GOPATH entries 2017-04-10 18:12:01 +00:00
html2article x/tools/cmd/html2article: remove unused functions 2017-03-01 14:53:04 +00:00
present x/tools: simplify and format code 2017-02-28 14:15:42 +00:00
ssadump tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
stress cmd/stress: flush out Usage doc 2017-06-12 21:12:06 +00:00
stringer cmd/stringer: use source importer when available 2017-04-12 18:56:47 +00:00
tip cmd/tip: manually scale talks to 1 instance 2017-06-13 23:21:29 +00:00
toolstash cmd/toolstash: use "go env GOROOT" instead of runtime.GOROOT() 2017-05-09 20:09:15 +00:00