From 404ab866d1522fbe4c5596fe9889d61aec84fabe Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 16 Nov 2018 15:51:49 -0800 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke Reviewed-by: Alan Donovan Reviewed-by: Josh Bleecher Snyder --- src/cmd/go/internal/load/pkg.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 3d1b0e649d7..ae738c6a12e 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -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) }