我正在使用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。 我该如何实现它? 在此先感谢。

2016-10-26 Radhika.S

+0

副手,听起来像“你不想要”。但我想'map '可能会工作,也许? –