title: How am I supposed to use protoc-gen-go-grpc?
body: <p>I am trying to generate Go code for some Protocol Buffers as well as a gRPC service.</p>
  <p>In the past I have used <code>https://github.com/golang/protobuf</code> with a generate command that looked something like this:</p>
  <pre><code>//go:generate protoc --proto_path=. --go-out=. --go_opt=paths=source_relative &lt;file&gt;.proto
  //go:generate protoc --proto_path=. --go_grpc_out=. --go_grpc_opt=paths=source_relative &lt;file&gt;.proto
  </code></pre>
  <p>This method worked just fine, but the repo has since been superceded by <code>google.golang.org/protobuf</code> and <code>google.golang.org/grpc</code>.</p>
  <p>From what I've read, this was an intentional split to separate the protobuf and gRPC project release cycles.</p>
  <p>Using the new repositories, I installed the tools like this:</p>
  <pre><code>go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
  go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
  </code></pre>
  <p>Both tools are installed, and are visible on the path. The problem that I'm encountering is that <code>protoc</code> or <code>protoc-gen-go</code> is looking for the older tool - <code>protoc-gen-go_grpc</code>. Note the underscore.</p>
  <p>I have been reading all the documentation and Github issues that I can find, and haven't yet been able to figure out how I am meant to use the new <code>protoc-gen-go-grpc</code>. Note the dash.</p>
  <pre><code>$ echo $GOPATH
  /Users/&lt;username&gt;/dev/go
  
  $ echo $GOBIN
  /Users/&lt;username&gt;/dev/go/bin
  
  $ which protoc
  /opt/homebrew/bin/protoc
  
  $ which protoc-gen-go
  /Users/&lt;username&gt;/dev/go/bin/protoc-gen-go
  
  $ which protoc-gen-go_grpc
  protoc-gen-go_grpc not found
  
  $ which protoc-gen-go-grpc
  /Users/&lt;username&gt;/dev/go/bin/protoc-gen-go-grpc
  </code></pre>