encoding/json: revert "fix decoding of JSON null values"

Fixes #11912.
Fixes #11937.

This reverts commit 1a99ba55df.

Change-Id: I32b76053fdabc59f28ca5bedf1b15c0baa8afae1
Reviewed-on: https://go-review.googlesource.com/12893
Reviewed-by: Didier Spezia <didier.06@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Russ Cox 2015-07-30 14:05:04 +00:00
parent e0c180c44f
commit 80e6d638bf
2 changed files with 2 additions and 76 deletions

View file

@ -358,7 +358,7 @@ func (d *decodeState) indirect(v reflect.Value, decodingNull bool) (Unmarshaler,
if v.IsNil() {
v.Set(reflect.New(v.Type().Elem()))
}
if v.Type().NumMethod() > 0 && !decodingNull {
if v.Type().NumMethod() > 0 {
if u, ok := v.Interface().(Unmarshaler); ok {
return u, nil, reflect.Value{}
}