Protocol buffers are a flexible, efficient, and automated mechanism for encoding and serializing structured data supported by Go. In this recipe, we will learn how to write our first protocol buffer.
Creating your first protocol buffer
Getting ready...
- Verify whether protoc is installed by executing the following command:
$ protoc --version
libprotoc 3.3.2
- Install protobuf by way of the following:
$ git clone https://github.com/google/protobuf
$ cd protobuf
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ make install
How to do it...
- Create hello.proto inside the proto...