diff options
Diffstat (limited to 'examples/README.txt')
-rw-r--r-- | examples/README.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/README.txt b/examples/README.txt index f5530a5e..e6f30370 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -27,3 +27,28 @@ These examples are part of the Protocol Buffers tutorial, located at: * Note that on some platforms you may have to edit the Makefile and remove "-lpthread" from the linker commands (perhaps replacing it with something else). We didn't do this automatically because we wanted to keep the example simple. + +## Go ## + +The Go example requires a plugin to the protocol buffer compiler, so it is not +build with all the other examples. See: + https://github.com/golang/protobuf +for more information about Go protocol buffer support. + +First, install the the Protocol Buffers compiler (protoc). +Then, install the Go Protocol Buffers plugin +($GOPATH/bin must be in your $PATH for protoc to find it): + go get github.com/golang/protobuf/protoc-gen-go + +Build the Go samples in this directory with "make go". This creates the +following executable files in the current directory: + add_person_go list_people_go +To run the example: + ./add_person_go addressbook.data +to add a person to the protocol buffer encoded file addressbook.data. The file +is created if it does not exist. To view the data, run: + ./list_people_go addressbook.data + +Observe that the C++, Python, and Java examples in this directory run in a +similar way and can view/modify files created by the Go example and vice +versa. |