Hello,

I'm trying to read gob-encoded data into a variable of interface type.  In 
simple cases, this works for me, but when I use a custom encoding 
via MarshalBinary() and UnmarshalBinary() methods, my code keeps crashing, 
with the error message

    panic: interface conversion: interface is nil, not 
encoding.BinaryUnmarshaler

Example:

- The code at https://play.golang.org/p/y8nWNhObUwb, letting gob do the 
en-/decoding works.

- The very similar code at https://play.golang.org/p/-zS7QjEJg9x, which 
uses MarshalBinary() and UnmarshalBinary() crashes with the panic shown 
above.

What am I doing wrong?

[I asked the same question at https://stackoverflow.com/questions/57485698/, 
with no answers so far]

Many thanks,
Jochen

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b19c51bc-524c-4292-915b-fc00e9289052%40googlegroups.com.

Reply via email to