ergo/irc/history/serialization.go
Shivaram Lingamneni 6ba60c89c4
Some checks are pending
build / build (push) Waiting to run
ghcr / Build (push) Waiting to run
move mysql serialization tools to shared pkgs
2025-12-30 23:34:05 -05:00

19 lines
458 B
Go

// Copyright (c) 2020 Shivaram Lingamneni
// released under the MIT license
package history
import (
"encoding/json"
)
// 123 / '{' is the magic number that means JSON;
// if we want to do a binary encoding later, we just have to add different magic version numbers
func MarshalItem(item *Item) (result []byte, err error) {
return json.Marshal(item)
}
func UnmarshalItem(data []byte, result *Item) (err error) {
return json.Unmarshal(data, result)
}