Open curio77 opened 5 years ago
Can you try with this PR? https://github.com/lunixbochs/struc/pull/63
That gives me a panic: array/slice of custom struct is not supported: [42]struc.Float16
.
@curio77 That's by design. The logic is: A panic is a better than working wrong. See #65
To summarize: #63 does fix the broken behavior by explicit panic which is good. Op‘s original issue of slice of struct not supported remains.
@lunixbochs wouldn‘t it make sense to merge #63? @13rac1 are you maintaining a fork intendend for public usage?
If I have a format definition like this:
then upon unpacking (haven't checked if it affects packing as well),
Field
will parse two bytes (as expected), butFields
will wrongly try to parse 42 × 8 bytes (the size offloat64
whichstruc.Float16
equates to) instead of 42 × 2.