On Tue, Jun 25, 2019 at 11:36 AM Andrew O'Neill <foolus...@gmail.com> wrote: > > I attempted to run the following command from a mac laptop (GOOS=darwin) > > GOBIN=/path/to/my/dir GOOS=linux go install > github.com/golang/protobuf/protoc-gen-go > > I get an error that go cannot install cross-compiled binaries when GOBIN is > set. Is there a technical limitation or is it just not implemented?
It's because normally `go install` would install to $GOPATH/bin/$GOOS_$GOARCH when cross-compiling. So when GOBIN is set there are two possibilities: install to a subdirectory, and not install to a subdirectory. There are arguments for either. Rather than surprise some people in some cases, the go tool requires you to say exactly what you want using the -o option. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXRDU5m-vnQD6tEnK0isNWCki8p2ESKQsWebhXwLh7dnA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.