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