Skip to content

Commit 1d3f30b

Browse files
jjlindsnet
authored andcommitted
README.md: document how to build a specific version of protoc-gen-go (#764)
1 parent 8d0c54c commit 1d3f30b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ To use this software, you must:
2424
https://golang.org/doc/install
2525
for details or, if you are using gccgo, follow the instructions at
2626
https://golang.org/doc/install/gccgo
27-
- Grab the code from the repository and install the proto package.
27+
- Grab the code from the repository and install the `proto` package.
2828
The simplest way is to run `go get -u github.com/golang/protobuf/protoc-gen-go`.
29-
The compiler plugin, protoc-gen-go, will be installed in $GOBIN,
30-
defaulting to $GOPATH/bin. It must be in your $PATH for the protocol
31-
compiler, protoc, to find it.
29+
The compiler plugin, `protoc-gen-go`, will be installed in `$GOPATH/bin`
30+
unless `$GOBIN` is set. It must be in your `$PATH` for the protocol
31+
compiler, `protoc`, to find it.
32+
- If you need a particular version of `protoc-gen-go` (e.g., to match your
33+
`proto` package version), one option is
34+
```shell
35+
GIT_TAG="v1.2.0" # change as needed
36+
go get -d -u github.com/golang/protobuf/protoc-gen-go
37+
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout $GIT_TAG
38+
go install github.com/golang/protobuf/protoc-gen-go
39+
```
3240

3341
This software has two parts: a 'protocol compiler plugin' that
3442
generates Go source files that, once compiled, can access and manage

0 commit comments

Comments
 (0)