Encoder does not take annotations and consequently Marshal cannot serialize values with annotations.
To get the annotations when Marshalling, user should send a struct to Marshal() whereby one field of the struct is a slice of string and tagged as ion:",annotations".
For instance:
type foo struct {
Value int
AnyName []string `ion:",annotations"`
}
...
val := foo{5, []string{"age"}}
buf := MarshalText(val)
Encoder does not take annotations and consequently Marshal cannot serialize values with annotations.
To get the annotations when Marshalling, user should send a struct to Marshal() whereby one field of the struct is a slice of string and tagged as
ion:",annotations"
.For instance: