You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Go] Fix for decoding into a struct with pre-allocated slices. (#825)
* [Go] Fix for decoding into a struct with pre-allocated slices.
This change allows you to call `Decode()` on an sbe struct where the struct has
pre-allocated slices. Before, the code would allocate a new slice if the
capacity on the existing slice was less than the number of groups in the
message. If the old slice had a greater capacity, it wouldn't truncate the
number of elements to the new length.
* [Go] Add test for decoding groups onto a pre-populated message.
* [Go] Add test for decoding when existing vardata values are shorter.
This tests that if the existing decoded struct has a vardata value with
length = 5, and the message to decode has length = 4, then the vardata
value is truncated to length 4.
0 commit comments