bytedance/sonic

Support configure tag when marshal/unmarshal

オープン

#440 opened on 2023/05/29

 (15 件のコメント) (0 件のリアクション) (0 人の担当者)Go (454 件のフォーク)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (9,488 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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" }

コントリビューターガイド