见具体错误信息
proto代码如下

syntax = "proto3";

package helloworld;

message Student{
            string tag = 1;
            message Tmp{
                message Line{
                    string line_name = 1;
                    int32 status = 2;
                    int32 ss = 3;
                    int32 bb = 4;
                }
                repeated Line line=2;
            }
            Tmp tmp = 2;
}


message Person{
    Student student = 1;
}


解决办法很简单,在proto里加两行代码

package helloworld;
option go_package = "./proto;helloworld";
// option go_package = "生成位置;包名";
// 完整代码
syntax = "proto3";

package helloworld;

option go_package = "./proto;helloworld";

message Student{
            string tag = 1;
            message Tmp{
                message Line{
                    string line_name = 1;
                    int32 status = 2;
                    int32 ss = 3;
                    int32 bb = 4;
                }
                repeated Line line=2;
            }
            Tmp tmp = 2;
}

message Person{
    Student student = 1;
}

生成成功

分类: go

站点统计

  • 文章总数:309 篇
  • 分类总数:19 个
  • 标签总数:191 个
  • 运行天数:1009 天
  • 访问总数:129527 人次

浙公网安备33011302000604

辽ICP备20003309号