bytedance/sonic

Support configure tag when marshal/unmarshal

开放

#440 创建于 2023年5月29日

 (15 条评论) (0 个反应) (0 位负责人)Go (454 个派生)github user discovery
enhancementgood first issue

仓库指标

星标
 (9,488 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

For example, I have a struct as follows, I want the id field to be omitted in json when writing http response, so I set tag json:"-", it's ok。 But when I want to marshal the same struct to redis (or unmarshal from redis) , I want the id field not to be omitted .So would you please allow developers to decide whether to ignore tag when marshal/unmarshal

type Example struct { Id int64 json:"-" IdStr string json:"id" }

贡献者指南