// common.proto
syntax = "proto3";
option go_package = "MsgHeader";
message Header {
string name = 1;
}
// aaa_project.proto that will be used in aaa project with go mod pattern:
syntax = "proto3";
option go_package = "aaa";
import "common.proto"; // 导入其他包的 proto 文件
service aaaService {
rpc OnPrivateMessage(stream msg) returns (stream msg) {} //上行私聊消息
}
// b_project.proto
// bbb_project.proto that will be used in aaa project with go mod pattern:
syntax = "proto3";
option go_package = "bbb";
import "common.proto"; // 导入其他包的 proto 文件
service bbbService {
rpc OnPrivateMessage(stream msg) returns (stream msg) {} //上行私聊消息
}
How to use common.proto for both aaa project and bbb project:they are diffenent fgo mods
Is there any way to share the same msg definition for go diffenent project with mod pattern
Situation:
How to use common.proto for both aaa project and bbb project:they are diffenent fgo mods Is there any way to share the same msg definition for go diffenent project with mod pattern