[go-nuts] Custom serializer issue

2017-02-25 Thread Tamás Gulácsi
I bet that the recursivity cause the problem. You decode in a different order than you encode. Separate your encoded chunks (refs, strings, sons, and the nodes) with indistinguishable blobs holding only a type info. I.e. 16 bytes of "REFSREFSREFSREFS..." only to ease debugging and allow asserti

[go-nuts] Custom serializer issue

2017-02-24 Thread Fabrice Vaillant
Hi For a custom project, I'm trying to write a serializer for a trie datastructure. I was using gob but it is slow due to it's use of reflect, and I wanted to learn something new. The struct is mainly composed of nodes: // Node implements a node of the tree type Node struct { // rw is a