0

I am very new to GO. In the process I am trying to implement a GRPC in my service. I am not able to use the protobuf compiler and not able to generate the pb file.

proto/greet.proto

syntax="proto3";

option go_package = "./proto";

package greet_service;

service GreetService {
    rpc sayHello(NoParams) returns (HelloResponse);

    rpc sayHelloServerStreaming(NameList) returns (stream HelloResponse);
    rpc sayHelloClientStreaming(stream HelloRequest) returns (MessageList);
    rpc sayHelloBidirectional(stream HelloRequest) returns (stream HelloResponse);
}

message HelloResponse {
    string message = 1;
}

message HelloRequest {
    string name = 1;
}

message NameList {
    repeated string name = 1;
}

message MessageList {
    repeated string message = 1;
}

message NoParams{}

enter image description here

My ~/.zshrc

export PATH="/usr/local/bin:$PATH"
export PATH=/opt/homebrew/bin:$PATH
export PATH=$PATH:$(go env GOPATH)/bin

The protoc command I am using is: protoc --go_out=. --go_grpc_out=. proto/greet.proto

Can someone help me with this please?

Ghost Chat
  • 51
  • 5

0 Answers0