How to do it...

  1. Create hello.proto inside the proto directory and define a service interface with the name Say, which has two datatypes—Request and Response, as follows:
syntax = "proto3";service Say {  rpc Hello(Request) returns (Response) {}}message Request {  string name = 1;}message Response {  string msg = 1;}
  1. Compile hello.proto with the following command:
$ protoc --go_out=plugins=micro:. hello.proto

Get Go Web Development Cookbook 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.