Here are my local Mac installations

  1. About GRPC and protobuf introduction and comparison and restful may refer to this introduction: https://golang2.eddycjy.com/p…
  2. The compiler PROTOC is installed in GRPC development, and we often need to deal with PROTOBUF. After we write the.proto file, we need to go to a compiler, which is PROTOC. PROTOC is the compiler for PROTOBUF, which is written in C++. The main function of this directory is to compile the.proto file to the root user, otherwise the subsequent make will not have permission.

    sudo -i
    cd /usr/local/lib
    wget https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz

    There are different versions, Tar-xzvf protobuf-all-3.17.3.tar.gz CD protobuf-all-3.17.3. /configure –prefix=/usr/local/protobuf Make && make install can also be multi-threaded to install the -j parameter, /usr/local/ PROTOBUF=/usr/local/ PROTOBUF=/usr/local/ PROTOBUF=/usr/local/ PROTOBUF=/usr/local/ PROTOBUF Export PATH=$PATH:$PROTOBUF/bin source ~/.bash_profile test protoc –version

  3. We installed the PROTOC compiler in the previous step, but this is not enough. For each language, the runtime PROTOC plugin is required. For each language, the runtime PROTOC-GEN-GO plugin is required. https://grpc.io/docs/language… $ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest specify version can also be installed But pay attention to the plug-in and the compiler version, Export PATH=”$PATH:$(GO ENV GOPATH)/bin” or export PATH=$PATH:$GOPATH/bin source ~/.bash_profile