简体   繁体   English

去协议缓冲区设置错误?

[英]go protocol buffer set up wrong?

I am trying to follow the instructions from https://github.com/golang/protobuf and https://github.com/google/protobuf/releases to install protocol buffer. 我正在尝试按照https://github.com/golang/protobufhttps://github.com/google/protobuf/releases中的说明安装协议缓冲区。 After I added the bin path from the download folder to $PATH , I tried to run protoc-gen-go , but it shows -bash: protoc-gen-go: command not found 将下载文件夹中的bin路径添加到$PATH ,我尝试运行protoc-gen-go ,但显示-bash: protoc-gen-go: command not found

Is there a way to tell if I have install the protobuf correctly? 有没有办法告诉我是否正确安装了protobuf?

Thanks. 谢谢。

Please repeat all steps: 请重复所有步骤:

go get -u github.com/golang/protobuf/protoc-gen-go
nano ~/.profile

check/add to the end (I don't use GOROOT) 检查/添加到末尾(我不使用GOROOT)

export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

reload profile (for sure) 重新加载配置文件(确定)

sudo shutdown -r now

try now 现在试试

protoc --go_out=. *.proto

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM