Closed dmitshur closed 7 years ago
@neelance Did you read the PR description or commit message, and it's still unclear? I can elaborate further, just want to make sure you didn't miss this:
This is needed after gopherjs/gopherjs#594 was resolved, because in Go 1.8,
go generate
setsGOARCH
to source platform it's running on, but we want it to be either unset orGOARCH=js
.This is very similar to issue gopherjs/gopherjs#601.
Without this change, you'd get the following error:
gopherjs: unsupported GOOS/GOARCH pair darwin/amd64
Yeah, I read it, but I didn't understand. Now that I looked again it is suddenly clear to me. ;-) But I have to say: Are we really sure that failing on a bad GOARCH
is a good idea? To me this seems a lot like ease of use should win by just always ignoring GOARCH
. Imho there is no proper benefit in the current solution. I liked it at first to be consistent with gc, but now I see the issues that it creates.
I'm not sure. I thought that users would only ever run into the issue if they explicitly set wrong GOARCH themselves. But that was before I found out that go generate always sets GOOS, GOARCH, etc.
Given that GopherJS only supports one value for target architecture, and never will support other targets (presumably), ignoring GOARCH env var is a valid option too.
But what do we do about GOOS?
But that was before I found out that go generate always sets GOOS, GOARCH, etc.
Exactly. Same here.
But what do we do about GOOS?
There is no issue with that, right? So keep it as is.
This PR is no longer needed after gopherjs/gopherjs#605. Closing.
This is needed after gopherjs/gopherjs#594 was resolved (/cc @bep), because in Go 1.8,
go generate
setsGOARCH
to source platform it's running on, but we want it to be either unset orGOARCH=js
.This is very similar to issue gopherjs/gopherjs#601 (/cc @DrJosh9000).
Also use tabs rather than spaces for indentation (since it no longer aligns anyway).
This was used locally to generate 37d98840c93dad01418d9aaf1dfb6c5df86f9d32.