vendor: json-iterator/go v1.1.10
full diff: https://github.com/json-iterator/go/compare/v1.1.9...v1.1.10 - Fix 459 map keys of custom types should serialize using MarshalText when available - Fix potential panic in (*stringAny).ToInt64 and (*stringAny).ToUint64 (see 450) - Fix 449 do NOT marshal the field whose name start with underscore - Reuse stream buffer and remove flush in (*Stream).WriteMore(see 441 440) - Fix 421 simplify the error string returned by the decoder when it meets error unmarshaling anonymous structs - Fix 389 411 do NOT marshal the json.RawMessage type field whose real type is integer/float as "null" with ValidateJsonRawMessage option enabled - Fix 326 do Not marshal private field after calling extra.SetNamingStrategy() to register naming strategy extension Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
4
vendor/github.com/json-iterator/go/config.go
generated
vendored
4
vendor/github.com/json-iterator/go/config.go
generated
vendored
@@ -183,11 +183,11 @@ func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
|
||||
encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) {
|
||||
rawMessage := *(*json.RawMessage)(ptr)
|
||||
iter := cfg.BorrowIterator([]byte(rawMessage))
|
||||
defer cfg.ReturnIterator(iter)
|
||||
iter.Read()
|
||||
if iter.Error != nil {
|
||||
if iter.Error != nil && iter.Error != io.EOF {
|
||||
stream.WriteRaw("null")
|
||||
} else {
|
||||
cfg.ReturnIterator(iter)
|
||||
stream.WriteRaw(string(rawMessage))
|
||||
}
|
||||
}, func(ptr unsafe.Pointer) bool {
|
||||
|
||||
Reference in New Issue
Block a user