You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When iter.ReadVal(obj) failed, the error did not propagate to the objectLazyAny.err.
Reproducing:
funcTestJsoniter(t*testing.T) {
api:= jsoniter.Config{
DisallowUnknownFields: true,
}.Froze()
varvstruct{ Foostring }
// using Any.ToVal cannot see any errorsobj:=api.BorrowIterator([]byte(`{"bar": true}`)).ReadAny()
obj.ToVal(&v)
t.Log(obj.LastError()) // this is nil, expecting "found unknown field: bar"// using ReadVal can see the expected errorsiter:=api.BorrowIterator([]byte(`{"bar": true}`))
iter.ReadVal(&v)
t.Log(iter.Error) // this is "found unknown field: bar"
}
The text was updated successfully, but these errors were encountered:
See the code in any_object.go
When
iter.ReadVal(obj)
failed, the error did not propagate to theobjectLazyAny.err
.Reproducing:
The text was updated successfully, but these errors were encountered: