Unmarshal provides a way to include annotations of Ion values. In order to do so, user needs to send a specific data structure, which is a struct with exactly 2 fields, one with ion:",annotation" tag, and the other a type which can hold the Ion value after decoding (in terms of type).
In the code base, unmarshal.go:
// expected struct for decoding Ion values must have only 2 fields: one has `ion:",annotation"`
// tag, and the other field must be of a type where Ion value can be decoded to.
func isValidAnnotatableStruct(v reflect.Value, listofkinds []reflect.Kind) (bool, error) {
Unmarshal provides a way to include annotations of Ion values. In order to do so, user needs to send a specific data structure, which is a struct with exactly 2 fields, one with
ion:",annotation"
tag, and the other a type which can hold the Ion value after decoding (in terms of type).In the code base,
unmarshal.go
: