原因:

是…\github.com\golang\protobuf\proto\buffer.go:文件缺少google.golang.org/protobuf/encoding/prototext包
其他报错也类似

解决办法:

下载包 :在https://github.com/protocolbuffers/protobuf-go/tree/master/ 下载
在%GOPATH%\google.golang.org\protobuf下 git clone https://github.com/protocolbuffers/protobuf-go.git,就可以了
再次go run *.main 就可以运行了

如果找不到对应google.golang.org包的话, 在访问 链接 google.golang.org/protobuf/encoding/prototext
根据相应找到 Index | Files 点击files 就可以找到github相应位置了,在执行上面步骤就可以了

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐