@@ -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
3341This software has two parts: a 'protocol compiler plugin' that
3442generates Go source files that, once compiled, can access and manage
0 commit comments