• Kirill Smelkov's avatar
    encoder: Fix struct encoding wrt protocol version · 95f42543
    Kirill Smelkov authored
    Similarly to dict, for struct encoding switch from protocol 1 opcodes
    into always using protocol 0 opcodes, which is by the way 1 byte
    shorter.
    
    For the reference - for structs, unlike maps, the order of emitted keys
    is well-defined - it is the order of fields as they are defined in the
    struct. This way we can precisely test encoder output on structs with
    more than 1 field.
    95f42543
encode.go 11.1 KB