mirror of
https://github.com/golang/go
synced 2024-11-23 06:30:06 -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:
parent
760ac1dd33
commit
404ab866d1
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user