// Try proto format first (authoritative).
if values := trailer[protoTrailerKey]; len(values) > 0 {
protoMsg := &contextpropagationspb.ContextMetadata{}
trailer_to_context_metadata_interceptor.go
err := proto.Unmarshal([]byte(values[0]), protoMsg)
if err != nil {
throttledLogger.Warn("TrailerToContextMetadataInterceptor: Failed to unmarshal proto trailer, falling back to legacy",
tag.Error(err),
)
}
for key, value := range protoMsg.GetEntries() {
trailerMetadata[key] = value