9

Developing a Protoc Plugin in Golang

In Chapter 7, we created an address book in Golang. In this chapter, we are going to iterate on the AddressBook and create a protoc plugin that generates Go code to validate the phone numbers and emails that the user inputs.

In this chapter, we are going to cover the following main topics:

  • Defining Protobuf custom options
  • Writing a custom protoc plugin

By the end of the chapter, you will be able to understand, at both theoretical and practical levels, what custom options and protoc plugins are. More importantly, you will be able to create them by yourself in Golang.

Technical requirements

All the code that you will see in this section can be found in the directory called chapter9 in the GitHub repository ...

Get Protocol Buffers Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.