Elliot
Elliot

Reputation: 580

GoKit and generating microservices install protoc error

The error shows me this

  1. I already downloaded those packages.
  2. still show me the error Please install protoc first and than rerun the command
$ kit generate service notifactor -t grpc --dmw
time="2019-03-06T16:35:29+08:00" level=error msg="Please install protoc first and than rerun the command"
time="2019-03-06T16:35:29+08:00" level=info msg="Install proto3.\nhttps://github.com/google/protobuf/releases\nUpdate protoc Go bindings via\n> go get -u github.com/golang/protobuf/proto\n> go get -u github.com/golang/protobuf/protoc-gen-go\n\nSee also\nhttps://github.com/grpc/grpc-go/tree/master/examples"

Upvotes: 0

Views: 201

Answers (1)

Saurav Prakash
Saurav Prakash

Reputation: 1949

From the go-kit source:

Using gRPC and go-kit together is very simple.

First, define your service using protobuf3. This is explained in gRPC documentation. See add.proto for an example. Make sure the proto definition matches your service's go-kit (interface) definition.

Next, get the protoc compiler.

You can download pre-compiled binaries from the protobuf release page. You will unzip a folder called protoc3 with a subdirectory bin containing an executable. Move that executable somewhere in your $PATH and you're good to go!

So just make sure protoc is in your PATH env var.

Upvotes: 2

Related Questions