]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use GOOS and GOARCH from build context for "go generate"
authorAndrew Gerrand <adg@golang.org>
Tue, 30 Jun 2015 05:35:01 +0000 (15:35 +1000)
committerAndrew Gerrand <adg@golang.org>
Tue, 30 Jun 2015 06:52:47 +0000 (06:52 +0000)
Fixes #11438

Change-Id: Iedd31918aa5187fc3fdaed71c8dad82075559084
Reviewed-on: https://go-review.googlesource.com/11667
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/go/generate.go

index a17f6e7747935926bf5f1948892436553a3c3eb2..98513ce122b5c3e789f5c328dedac5fdf37f0e40 100644 (file)
@@ -347,9 +347,9 @@ func (g *Generator) errorf(format string, args ...interface{}) {
 func (g *Generator) expandVar(word string) string {
        switch word {
        case "GOARCH":
-               return runtime.GOARCH
+               return buildContext.GOARCH
        case "GOOS":
-               return runtime.GOOS
+               return buildContext.GOOS
        case "GOFILE":
                return g.file
        case "GOLINE":