Skip to content

Conversation

@TheWinds
Copy link
Contributor

not encode zero value

if a JSON object contains fields with zero value (such as "",0,null,[])
jtop will not encode those fields to protobuf anymore.

@vizee
Copy link
Contributor

vizee commented Dec 29, 2020

fynb

}

func (e *Encoder) transString(token *Token, field *metadata.Field) {
if len(token.Value) == 2 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transString 不能只通过判断空字符串跳过,在 {"a": ["", "", ""]} 情况下,假设 a 的 tag 为 1,应该返回 [10, 0, 10, 0, 10, 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants