From cad3e03f94995334ebed94770ac497367e484cba Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 18 Aug 2018 01:11:50 +0200 Subject: [PATCH] Allow imports from GOROOT --- compiler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler.go b/compiler.go index bad64abd..9387c79b 100644 --- a/compiler.go +++ b/compiler.go @@ -8,6 +8,7 @@ import ( "go/token" "go/types" "os" + "runtime" "strconv" "strings" @@ -137,6 +138,7 @@ func (c *Compiler) Parse(mainPath string, buildTags []string) error { GOARCH: tripleSplit[0], GOOS: tripleSplit[2], GOROOT: ".", + GOPATH: runtime.GOROOT(), CgoEnabled: true, UseAllFiles: false, Compiler: "gc", // must be one of the recognized compilers