Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: variable built-in of "go generate" #11438

Closed
noliar opened this issue Jun 27, 2015 · 2 comments
Closed

cmd/go: variable built-in of "go generate" #11438

noliar opened this issue Jun 27, 2015 · 2 comments
Milestone

Comments

@noliar
Copy link

noliar commented Jun 27, 2015

I think $GOARCH and $GOOS in "go generate" should depend on the environment variable first, like other go commands.

@adg
Copy link
Contributor

adg commented Jun 30, 2015

I can confirm:

$ cat gen.go 
package test

//go:generate echo $GOOS
$ go generate gen.go
darwin
$ GOOS=linux go generate gen.go
darwin

The code in cmd/go/generate.go uses runtime.GOARCH and runtime.GOOS for these values. It should probably use the values from the buildContext global variable.

@adg adg self-assigned this Jun 30, 2015
@gopherbot
Copy link

CL https://golang.org/cl/11667 mentions this issue.

@adg adg closed this as completed in ab9c25f Jun 30, 2015
@mikioh mikioh added this to the Go1.5 milestone Jun 30, 2015
@golang golang locked and limited conversation to collaborators Jun 29, 2016
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants