This is a created article in which the information may have evolved or changed.
Protoc command from Https://github.com/google/protobuf, because there is no go to generate code, go generated code in Protoc-gen-go (https://github.com/golang/ protobuf/) here.
$ Protoc--go_out=./go/./proto/helloworld.proto
$ Protoc--go_out=plugins=grpc:./go2/./proto/helloworld.proto
Above two commands, the first one produces only the code that protobuffer the file serialization and deserialization.
The second produces the common library code that the server and client communicate and implement, in addition to the first code.
Https://github.com/grpc/grpc-go the package name that corresponds to this code is:google.golang.org/grpc 这里只是一些公共函数库, protoc 和 protoc-gen-go 这两个工具都不在这里。
产生 protoc-gen-go 这个工具的方法如下:
$ go get-u github.com/golang/protobuf/protoc-gen-go