forked from mirror/go-json
Add omitempty and string operation for vm
This commit is contained in:
parent
7d7a5163c4
commit
4823e8bed3
|
@ -79,3 +79,12 @@ func appendComma(b []byte) []byte {
|
||||||
func appendStructEnd(b []byte) []byte {
|
func appendStructEnd(b []byte) []byte {
|
||||||
return append(b, '}', ',')
|
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
|
@ -79,3 +79,12 @@ func appendComma(b []byte) []byte {
|
||||||
func appendStructEnd(b []byte) []byte {
|
func appendStructEnd(b []byte) []byte {
|
||||||
return append(b, '}', ',')
|
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
|
@ -79,3 +79,12 @@ func appendComma(b []byte) []byte {
|
||||||
func appendStructEnd(b []byte) []byte {
|
func appendStructEnd(b []byte) []byte {
|
||||||
return append(b, '}', ',')
|
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
Loading…
Reference in New Issue