Closed errorhandler closed 2 years ago
Hi, thanks for your contribution!
It looks like the CI build failed because one of our Github Workflows was broken. I've fixed the workflow now. Do you mind rebasing your commit against the tip of master
in amzn/ion-go
so that we can re-run with the fixed workflow? Alternately, you could grant me permission to edit the PR, and I'll update it.
HI, can you please provide an example of how to use UnmarshalIon?
Given the struct:
type Account struct {
Name string `ion:"name"`
}
I write the function:
func (a *Account) UnmarshalIon(b []byte) error {
fmt.Println("In Unmarshall")
a.Name = "boo"
return nil
}
The above implementation does not work.
Needless to say: Im learning Go.
Thanks!
Issue #, if available: #184
Description of changes: Adds the unmarshalling equivalent of
Marshaler
. Allowing types to implement their own unmarshalling logic. It's basically the same implementation, but requires theUnmarshalIon
method to be implemented with a pointer receiver as it needs to mutate the struct.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.