Closed gotwarlost closed 7 years ago
Test case: https://gist.github.com/gotwarlost/6cf38fc5f554ff1ec06aa4b045912060
produces:
$ rdl-bug 2017/05/12 16:13:19 { "id": "me", "name": "Krishnan", "Title": "Mr." } panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x129f754] ...
Embedding a type works if you specify the embedded type, not a pointer to it. As a pointer, it is up to the containing instance to initialize it with storage before unmarshaling.
Test case: https://gist.github.com/gotwarlost/6cf38fc5f554ff1ec06aa4b045912060
produces: