我正在使用grpc golang在客戶端和服務器應用程序之間進行通信。 下面是protoc緩衝區的代碼。在gRPC protoc緩衝區中創建類型爲Map [string] interface {}的變量golang
syntax = "proto3";
package Trail;
service TrailFunc {
rpc HelloWorld (Request) returns (Reply) {}
}
// The request message containing the user's name.
message Request {
map<string,string> inputVar = 1;
}
// The response message containing the greetings
message Reply {
string outputVar = 1;
}
我需要創建類型映射[字符串]界面{}消息數據結構,而不是圖[字符串]字符串內的一個字段inputVar。 我該如何實現它? 在此先感謝。
副手,聽起來像「你不想要」。但我想'map'可能會工作,也許? –
Vatine