• Didier Spezia's avatar
    encoding/json: fix decoding of JSON null values · 1a99ba55
    Didier Spezia authored
    JSON decoding currently fails for null values bound to any type
    which does implement the JSON Unmarshaler interface without checking
    for null values (such as time.Time).
    
    It also fails for types implementing the TextUnmarshaler interface.
    
    The expected behavior of the JSON decoding engine in such case is
    to process null by keeping the value unchanged without producing
    any error.
    
    Make sure null values are handled by the decoding engine itself,
    and never passed to the UnmarshalText or UnmarshalJSON methods.
    
    Fixes #9037
    
    Change-Id: I261d85587ba543ef6f1815555b2af9311034d5bb
    Reviewed-on: https://go-review.googlesource.com/9376Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    1a99ba55
Name
Last commit
Last update
..
testdata Loading commit data...
bench_test.go Loading commit data...
decode.go Loading commit data...
decode_test.go Loading commit data...
encode.go Loading commit data...
encode_test.go Loading commit data...
example_test.go Loading commit data...
fold.go Loading commit data...
fold_test.go Loading commit data...
indent.go Loading commit data...
scanner.go Loading commit data...
scanner_test.go Loading commit data...
stream.go Loading commit data...
stream_test.go Loading commit data...
tagkey_test.go Loading commit data...
tags.go Loading commit data...
tags_test.go Loading commit data...