【发布时间】:2017-03-08 15:48:38
【问题描述】:
我正在使用 grpc golang 在客户端和服务器应用程序之间进行通信。 下面是 protoc 缓冲区的代码。
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;
}
我需要在消息数据结构中创建一个 map[string]interface{} 类型的字段 inputVar,而不是 map[string]string。 我怎样才能实现它? 提前致谢。
【问题讨论】:
-
副手,这听起来像“你不想”。但我猜
map<string,google.protobuf.Any>可能有用,也许吧?