package mdb import ( "encoding/json" ) func decode[T any](data []byte) *T { item := new(T) must(json.Unmarshal(data, item)) return item } func encode(item any) []byte { buf, err := json.Marshal(item) must(err) return buf }