We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following this example, I have written the below code:
package main import ( "bytes" "fmt" "github.com/amzn/ion-go/ion" ) func main() { UnmarshalCustomMarshaler() } type unmarshalMe struct { Name string custom bool } func (u *unmarshalMe) UnmarshalIon(r ion.Reader) error { fmt.Print("UnmarshalIon called") u.custom = true return nil } func UnmarshalCustomMarshaler() { ionBinary, err := ion.MarshalBinary(unmarshalMe{ Name: "John Doe", }) if err != nil { fmt.Println("Error marshalling ion binary: ", err) panic(err) } dec := ion.NewReader(bytes.NewReader(ionBinary)) var decodedResult unmarshalMe ion.UnmarshalFrom(dec, &decodedResult) fmt.Println("Decoded result: ", decodedResult) }
Expected result is that u.custom is true, this is not the case: u.custom is false.
u.custom
Is this a bug, or have i misunderstanded how to implement custom unmarshal?
The text was updated successfully, but these errors were encountered:
Hi,
You should probably look at the version, you are using. The latest version v1.1.3 does not contain the feature.
Sorry, something went wrong.
You are correct, thanks.
I've just released v1.2.0 which does contain the feature in #185.
No branches or pull requests
Following this example, I have written the below code:
Expected result is that
u.custom
is true, this is not the case:u.custom
is false.Is this a bug, or have i misunderstanded how to implement custom unmarshal?
The text was updated successfully, but these errors were encountered: