1
0
mirror of https://github.com/golang/go synced 2024-11-23 03:40:02 -07:00

cmd/go: packages that use SWIG depend on "unsafe"

Fixes #28834

Change-Id: I95d6874e62d36974415f43843881a4ae85b3c7ce
Reviewed-on: https://go-review.googlesource.com/c/149964
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Ian Lance Taylor 2018-11-16 15:51:49 -08:00 committed by Josh Bleecher Snyder
parent 760ac1dd33
commit 404ab866d1

View File

@ -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)
}