Skip to content

Commit

Permalink
cmd/go: packages that use SWIG depend on "unsafe"
Browse files Browse the repository at this point in the history
Fixes #28834

Change-Id: I95d6874e62d36974415f43843881a4ae85b3c7ce
Reviewed-on: https://go-review.googlesource.com/c/149964
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Emmanuel Odeke <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
Reviewed-by: Josh Bleecher Snyder <[email protected]>
  • Loading branch information
ianlancetaylor authored and josharian committed Nov 18, 2018
1 parent 760ac1d commit 404ab86
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/go/internal/load/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,7 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {

// SWIG adds imports of some standard packages.
if p.UsesSwig() {
addImport("unsafe", true)
if cfg.BuildContext.Compiler != "gccgo" {
addImport("runtime/cgo", true)
}
Expand Down

0 comments on commit 404ab86

Please sign in to comment.