I. GOCTL installation

  • Run the following command

    GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl
  • The configuration file

    • sudo vim /etc/paths
    • Add $goPath /bin on the last line

2, Protoc-Gen-Go installation

  • Under the SRC directory under $GOPATH download protobuf source: git clone mailto:[email protected]: protocolbuffers/protobuf git
  • Go to the protoc-gen-go directory and execute the following Go Build and Go Install commands. The protoc-gen-go executable is automatically generated in the $GOPATH/bin directory when the command is executed.
  • If the source code is not in SRC, you will need to move the protoc-gen-go executable to the $goPath /bin directory, otherwise the executable will not be found.

Three, PROTOC installation

  • Download the source: https://github.com/protocolbu…
  • Go to the bin directory under the source code, find the protoc binary file, and move the protoc file to the $goPath /bin directory
  • The installation was successful when executing the protoc –version view