refactor: add more type cases to marshallMapMsgpack

This commit is contained in:
Derrick Hammer 2024-01-05 06:04:46 -05:00
parent c3a696138a
commit 6c27a978d1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 12 additions and 0 deletions

View File

@ -80,6 +80,18 @@ func marshallMapMsgpack(enc *msgpack.Encoder, m *linkedhashmap.Map) error {
if err := enc.Encode(&v); err != nil { if err := enc.Encode(&v); err != nil {
return err return err
} }
case string:
if err := enc.EncodeString(v); err != nil {
return err
}
case int:
if err := enc.EncodeInt(int64(v)); err != nil {
return err
}
case FileVersion:
if err := enc.Encode(&v); err != nil {
return err
}
default: default:
return fmt.Errorf("unsupported type for encoding") return fmt.Errorf("unsupported type for encoding")
} }