go icon indicating copy to clipboard operation
go copied to clipboard

any ObjectValue does not support toVal()

Open TCBeliever opened this issue 3 years ago • 0 comments

     p := DataTime{
         DateFormat: "yyyy/MM/dd",
         TimeFormat: "HH:mm",
     }
     any := jsoniter.Wrap(p)
     t.Logf("type object:%v", any.ValueType() == jsoniter.ObjectValue)
     t.Logf("string:%v", any.ToString())

     s, _ := jsoniter.MarshalToString(any)
     t.Logf("serial json:%v", s)
     any.ToVal(&p)
     t.Logf("to object:%v", p)

this code MarshalToString has empty result, and panic when any.ToVal() any suggestion?

TCBeliever avatar Dec 09 '22 07:12 TCBeliever