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

Update protoc-gen-grpc-gateway go get command #1929

Closed
wants to merge 1 commit into from
Closed

Update protoc-gen-grpc-gateway go get command #1929

wants to merge 1 commit into from

Conversation

seantcanavan
Copy link

@seantcanavan seantcanavan commented Jan 27, 2021

go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway returns an error:

Tue Jan 26 10:03 PM ~: go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
package github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway: cannot find package "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway" in any of:
/usr/lib/go-1.13/src/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway (from $GOROOT)
/home/userhome/go/src/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway (from $GOPATH

References to other Issues or PRs

Have you read the Contributing Guidelines?

Brief description of what is fixed or changed

Other comments

go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway returns an error:

Tue Jan 26 10:03 PM ~: go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
package github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway: cannot find package "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway" in any of:
	/usr/lib/go-1.13/src/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway (from $GOROOT)
	/home/userhome/go/src/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway (from $GOPATH
@google-cla
Copy link

google-cla bot commented Jan 27, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@codecov-io
Copy link

Codecov Report

Merging #1929 (51a9090) into master (61fef09) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1929   +/-   ##
=======================================
  Coverage   57.96%   57.96%           
=======================================
  Files          34       34           
  Lines        3771     3771           
=======================================
  Hits         2186     2186           
  Misses       1311     1311           
  Partials      274      274           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61fef09...51a9090. Read the comment docs.

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @seantcanavan, thanks for your contribution, unfortunately, this change is not an appropriate fix. The error you're seeing happens when trying to go get the grpc-gateway in GOPATH mode. The correct fix here is to set GO111MODULE=on, which will be the default in 1.16. Can you try the suggestion and confirm it fixes your issue? It works for me locally.

@@ -30,7 +30,7 @@ We will be using a Go gRPC server in the examples, so please install Go first fr
After installing Go, use `go get` to download the following packages:

```sh
$ go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
$ go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
$ GO111MODULE=on go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway

@seantcanavan
Copy link
Author

@johanbrandhorst thanks for the help! my project was using go modules but I didn't realize I had to set it globally. I'm using 1.13.8 which is the default for ubuntu 20 right now. I appreciate your patience with all this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants