From 26de2f9a7d3b1826f275e7a97c8cad5080589426 Mon Sep 17 00:00:00 2001 From: Chotepud Teo Date: Mon, 22 Jan 2018 00:00:31 +0800 Subject: [PATCH] Added instructions for using proto files from google/protobuf (#371) Fixes #370 --- Readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Readme.md b/Readme.md index bb0dbb5d4c..a4ad3eecd0 100644 --- a/Readme.md +++ b/Readme.md @@ -105,6 +105,16 @@ To generate the code, you also need to set the include path properly. protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --{binary}_out=. myproto.proto +To use proto files from "google/protobuf" you need to add additional args to protoc. + + protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --{binary}_out=\ + Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\ + Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\ + Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\ + Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\ + Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types:. \ + myproto.proto + Note that in the protoc command, {binary} does not contain the initial prefix of "protoc-gen". ### Most Speed and most customization