refactor: make InitMarshaller signature consistent with InitUnmarshaller

This commit is contained in:
Derrick Hammer 2024-02-29 23:36:48 -05:00
parent 2bf906d31c
commit fd786ac3c1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ func NewDirectoryMetadata(details DirectoryMetadataDetails, directories director
return dirMetadata
}
func (dm *DirectoryMetadata) EncodeMsgpack(enc *msgpack.Encoder) error {
err := serialize.InitMarshaller(types.MetadataTypeDirectory, enc)
err := serialize.InitMarshaller(enc, types.MetadataTypeDirectory)
if err != nil {
return err
}

View File

@ -38,7 +38,7 @@ func NewEmptyWebAppMetadata() *WebAppMetadata {
}
func (wm *WebAppMetadata) EncodeMsgpack(enc *msgpack.Encoder) error {
err := serialize.InitMarshaller(types.MetadataTypeWebApp, enc)
err := serialize.InitMarshaller(enc, types.MetadataTypeWebApp)
if err != nil {
return err
}

View File

@ -7,7 +7,7 @@ import (
"slices"
)
func InitMarshaller(kind types.MetadataType, enc *msgpack.Encoder) error {
func InitMarshaller(enc *msgpack.Encoder, kind types.MetadataType) error {
err := enc.EncodeInt(types.MetadataMagicByte)
if err != nil {
return err