aboutsummaryrefslogtreecommitdiff
path: root/examples/README.txt
diff options
context:
space:
mode:
authorFeng Xiao <xiaofeng@google.com>2015-11-30 13:43:56 -0800
committerFeng Xiao <xiaofeng@google.com>2015-11-30 13:43:56 -0800
commit1a59a715dc5fa584340197aac0811ba3de9850b5 (patch)
tree054a47a347534b6bdb31dcf08b24f7cc07f5669e /examples/README.txt
parentf4e4be638634b74cbc9be10150bd8bf7a6cb4e8d (diff)
parent7e31c4d930efa3f80d0f03c93e788ba73b847fd8 (diff)
downloadprotobuf-1a59a715dc5fa584340197aac0811ba3de9850b5.tar.gz
protobuf-1a59a715dc5fa584340197aac0811ba3de9850b5.tar.bz2
protobuf-1a59a715dc5fa584340197aac0811ba3de9850b5.zip
Merge pull request #998 from tswast/goexample
Add a Go language example.
Diffstat (limited to 'examples/README.txt')
-rw-r--r--examples/README.txt25
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.