diff --git a/encoding/json/json.go b/encoding/json/json.go index 1f57c2599..c03ceb762 100644 --- a/encoding/json/json.go +++ b/encoding/json/json.go @@ -24,7 +24,7 @@ func (codec) Marshal(v interface{}) ([]byte, error) { func (codec) Unmarshal(data []byte, v interface{}) error { rv := reflect.ValueOf(v) for rv.Kind() == reflect.Ptr { - if rv.IsNil() && rv.CanSet() { + if rv.IsNil() && rv.CanInterface() { rv.Set(reflect.New(rv.Type().Elem())) v = rv.Interface() }