Add omitempty and string operation for vm

This commit is contained in:
Masaaki Goshima 2021-05-07 00:53:39 +09:00
parent 7d7a5163c4
commit 4823e8bed3
6 changed files with 2739 additions and 336 deletions

View File

@ -79,3 +79,12 @@ func appendComma(b []byte) []byte {
func appendStructEnd(b []byte) []byte {
return append(b, '}', ',')
}
func appendStructEndSkipLast(b []byte) []byte {
last := len(b) - 1
if b[last] == ',' {
b[last] = '}'
return appendComma(b)
}
return appendStructEnd(b)
}

File diff suppressed because it is too large Load Diff

View File

@ -79,3 +79,12 @@ func appendComma(b []byte) []byte {
func appendStructEnd(b []byte) []byte {
return append(b, '}', ',')
}
func appendStructEndSkipLast(b []byte) []byte {
last := len(b) - 1
if b[last] == ',' {
b[last] = '}'
return appendComma(b)
}
return appendStructEnd(b)
}

File diff suppressed because it is too large Load Diff

View File

@ -79,3 +79,12 @@ func appendComma(b []byte) []byte {
func appendStructEnd(b []byte) []byte {
return append(b, '}', ',')
}
func appendStructEndSkipLast(b []byte) []byte {
last := len(b) - 1
if b[last] == ',' {
b[last] = '}'
return appendComma(b)
}
return appendStructEnd(b)
}

File diff suppressed because it is too large Load Diff