protoc & protoc-gen-go安装

    protoc is a tool written in C++, which can translate proto files into codes in the specified language. In the go-zero microservices, we use grpc to communicate between services, and the writing of grpc requires the use of protoc and the plug-in protoc-gen-go that translates into go language rpc stub code.

    • mac OS

    protoc installation

    • Enter the page and select the compressed package file suitable for your operating system
    • Unzip and enter protoc-3.14.0-osx-x86_64
    • Move the started protoc binary file to any path added to the environment variable, such as $GOPATH/bin. It is not recommended putting it directly with the next path of the system.
      1. $ mv protoc $GOPATH/bin