golang:安装protobuf

  • 安装 protoc-gen-go

    • 下载 https://github.com/golang/protobuf 到 $GOPATH/src/github/golang/protobuf
    cd $GOPATH/src/github/golang/
    git clone [email protected]:golang/protobuf.git
    
    • 下载 https://github.com/protocolbuffers/protobuf-go 到 $GOPATH/src/google.golang.org/protobuf
    cd  $GOPATH/src/google.golang.org/
    git clone [email protected]:protocolbuffers/protobuf-go.git
    mv protobuf-go protobuf
    
    • 编译
    go install google.golang.org/protobuf/cmd/protoc-gen-go
    
    • 去$GOPATH/bin 中找找看有没有
  • 安装 protoc

    • https://blog.csdn.net/qq_38410730/article/details/103679529

参考资料

  • https://developers.google.com/protocol-buffers/docs/gotutorial
  • https://blog.csdn.net/qq_38410730/article/details/103679529

你可能感兴趣的:(golang,golang,protobuf,go)