zeebo/bencode

ensure encoding works with pointer receivers well

zeebo opened this issue · 4 comments

zeebo commented

we need to be careful around our usage of indirect and checking if the value implements some interface during encoding. i suspect there are some bugs.

I suppose this also applies to the original RawMessage "cast", @zeebo?

zeebo commented

yeah i think so. i think we just need to rethink the top of encodeValue and decodeValue.

specifically, maybe we have to extend indirect to check for interfaces at every level and return whichever as early as possible...

Sounds like a good idea indeed. I'll do some research and think about it when I get to it.

@zeebo my solution can be found as PR #29.