针对你遇到的“import "google/protobuf/empty.proto" was not found or had errors”的问题,我可以从以下几个方面为你提供解决方案: 检查Protocol Buffers编译器(protoc)和相关库的安装: 确保你已经正确安装了Protocol Buffers编译器(protoc)以及相关的Go插件(如protoc-gen-go和protoc-gen-go-grpc)。你可以通过...
一.问题产生背景 最近业务中在对接grpc 接口,其中grpc 采用了protobuf 这种结构化的数据存储格式,可用于结构化数据的序列化,目前官方中已经支持多种语言。在一个proto 文件 import 另一个proto 文件,编译时报错 (Import "zeus/file.proto" was not found or had errors) 问题,接下来还原一下产生的这个问题; 二...
最近业务中在对接grpc 接口,其中grpc 采用了protobuf 这种结构化的数据存储格式,可用于结构化数据的序列化,目前官方中已经支持多种语言。在一个proto 文件 import 另一个proto 文件,编译时报错 (Import "zeus/file.proto" was not found or had errors) 问题,接下来还原一下产生的这个问题;
[已解决!]Import "google/protobuf/descriptor.proto" was not found or had errors. 解决步骤: 1:先在IDE访问google/protobuf/descriptor.proto将其copy 2:创建类似结构 -gopath -src-google -protobuf -descriptor.proto 3.将copy的文件赋值到descriptor.proto中(或不需要创建直接下载https://github.com/protoc...
使用命令行编译xxxx.proto时报错。 报错信息 google/protobuf/any.proto: File not found. xxxxxx.proto:4:1: Import "google/protobuf/any.proto" was not found or had errors. xxxxxx.proto:12:5: "google.protobuf.Any" is not defined.
import "src/help.proto"; 导入了一个外部proto文件中的定义,类似于C++中的 include 。不过好像只能import当前目录及当前目录的子目录中的proto文件,比如import父目录中的文件时编译会报错(Import "../xxxx.proto" was not found or had errors.),使用绝对路径也不行,尚不清楚原因,官方文档说使用 -I=PATH 或者...
protobuf 里面“import “google/protobuf/empty.proto”;” ,飘红, 编译的时候,Import “google/protobuf/empty.proto” was not found or had errors.“google.protobuf.Empty” is not defined. 查了不少资料也没解决,有点抓狂。您遇到过这个问题吗...
google/protobuf/empty.proto: File not found. user.proto:2:1: Import "google/protobuf/empty.proto" was not found or had errors. user.proto:10:44: "google.protobuf.Empty" is not defined. 执行protoc --go_out=. --go-grpc_out=. user.proto 报错。 但是在 user.proto 中可以正常跳转到...
srpc.proto:10:8: "google.protobuf.MethodOptions" is not defined. user_asset_interface_service.proto: Import "srpc.proto" was not found or had errors. [ops account_test]$ 修改:去掉部分后缀后,运行成功 protoc -I=/usr/local/include/ -I=./ --python_out=./ ./user_asset_interface_servic...
user.proto:6:1: Import"google/protobuf/timestamp.proto"was not found or had errors. user.proto:14:3:"google.protobuf.Timestamp"is not defined. user.proto:15:3:"google.protobuf.Timestamp"is not defined.make: *** [Makefile:15:grpc-go] 错误1 ...