Skip to content

Commit

Permalink
cmd/go: use GOOS and GOARCH from build context for "go generate"
Browse files Browse the repository at this point in the history
Fixes #11438

Change-Id: Iedd31918aa5187fc3fdaed71c8dad82075559084
Reviewed-on: https://go-review.googlesource.com/11667
Reviewed-by: Rob Pike <r@golang.org>
  • Loading branch information
adg committed Jun 30, 2015
1 parent b8d2d6b commit ab9c25f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/go/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit ab9c25f

Please sign in to comment.