You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-27 23:18:42 +02:00
#90 trim spaces when UnmarshalJSON
This commit is contained in:
@ -618,6 +618,8 @@ func (decoder *unmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
||||
templateInterface.word = ptr
|
||||
realInterface := (*interface{})(unsafe.Pointer(&templateInterface))
|
||||
unmarshaler := (*realInterface).(json.Unmarshaler)
|
||||
iter.nextToken()
|
||||
iter.unreadByte() // skip spaces
|
||||
bytes := iter.SkipAndReturnBytes()
|
||||
err := unmarshaler.UnmarshalJSON(bytes)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user