go icon indicating copy to clipboard operation
go copied to clipboard

Any.ToVal()方法丢失了error

Open xczh opened this issue 4 years ago • 0 comments

	api := jsoniter.Config{
		DisallowUnknownFields: true,
	}.Froze()
	any := api.Get([]byte(`{"data":[{"a":1}]}`), "data")
	var data []struct{}
	any.ToVal(&data)
	if err := any.LastError(); err != nil {
		panic(err)
	}

如代码所示,ToVal方法没有返回error,LastError()始终返回nil

请问如何修复?

xczh avatar Mar 08 '21 11:03 xczh