使用gRPC的上下文与SendMsg / RecvMsg方法发送元数据

I really don't get what's the benefit of sending metadata through gRPC's context, which can only handle strings (binary data is base64 'd), while it is possible to use SendMsg() to send a well-known and defined protobuf type, and get rid of string-based serialization.

Why using the context is the only documented way of exchanging metadata?

By metadata we mean information that is added to http headers and in turn looked at by the server at the beginning of an RPC. This information could've been auth related information or some other metadata that an interceptor or service handler might want to look at to do some pre-processing before data exchange begins. Hope this is helpful.