当我试图在Golang中编译Protobuf时,它显示了“ int”未定义。'
在编译原始文件时,我得到的“ int”不是定义的'。
'test.proto'文件
syntax = "proto3";
package test;
option go_package = "/;test";
message User {
string FirstName = 1;
string LastName = 2;
string Address = 3;
int Contact = 4;
int Age = 5;
}
Output:
test.proto:11:5: "int" is not defined.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
int
不是proto3中的标量类型。您必须使用指定的有效标量值类型之一:Replacing
int
带有int32
:int
is not a scalar type in proto3. You must use one of the valid scalar value types as specified:https://developers.google.com/protocol-buffers/docs/proto3#scalar
Replacing
int
withint32
: