Closed yarikk closed 2 years ago
Looks good. This was the case I'm worried about, but it fails as I hoped. Does that make sense? If so I'll merge.
Let me rebase and add a length check as a condition for the conversion.
Update: no need for length check: that's part of IP.To4
already.
Rebased, added a boilerplate "if" (based on To4
usage examples in the Go's net packages itself), added panic tests.
CompactIPv4NodeAddrs.MarshalBinary
can not serialise results ofnet.IPv4
directly, requiring additionalTo4
call.The included test flags the issue:
The proposed fix is to take same approach as in
CompactIPv4NodeInfo.MarshalBinary
.Fixes #33.