Skip to content

Commit

Permalink
bump goccy/go-json to 0.9.4 (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed Feb 12, 2022
1 parent 1fd6eab commit aa56364
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/go-json/encoder/code.go
Expand Up @@ -436,12 +436,13 @@ func (c *StructCode) ToOpcode(ctx *compileContext) Opcodes {
}
if isEndField {
endField := fieldCodes.Last()
if len(codes) > 0 {
codes.First().End = endField
} else if field.isAnonymous {
if field.isAnonymous {
firstField.End = endField
lastField := c.lastAnonymousFieldCode(firstField)
lastField.NextField = endField
}
if len(codes) > 0 {
codes.First().End = endField
} else {
firstField.End = endField
}
Expand Down
2 changes: 2 additions & 0 deletions internal/go-json/encoder/encoder.go
Expand Up @@ -589,6 +589,8 @@ func IsNilForMarshaler(v interface{}) bool {
return rv.IsNil()
case reflect.Slice:
return rv.IsNil() || rv.Len() == 0
case reflect.String:
return rv.Len() == 0
}
return false
}

0 comments on commit aa56364

Please sign in to comment.