#1673·protobuf

允许用户向 `protojson` 传递 `io.Writer`

作者: denysvitali创建于 2025年1月21日更新于 2026年7月20日
标签help-wantedperformance

此问题适用于哪种语言?

golang (protocolbuffers/protobuf-go)

请描述您要解决的问题。

作为 https://GitHub.com/open-telemetry/opentelemetry-collector/issues/7095 的一部分,我们希望切换到新的 Protobuf 透明 API,以提高 opentelemetry-collector 的性能(特别是将遥测数据导出为 JSON 时)。我们希望使用 encoding/protojson,但当前实现不允许用户传递一个 io.Writer。用于编码 JSON 的唯一方法是:

内容来源: golang/protobuf