bloat/unmarshal.go

26 lines
366 B
Go

package bloat
import (
"encoding/xml"
"fmt"
)
/*
types to decode:
.phish (identity)
.bivouac (decisions)
.cicada (indexes/feeds)
.crew (groups)
.mores (rules)
*/
func (b *Bloat[T]) unmarshal(plain []byte) (T, error) {
var res T
err := xml.Unmarshal(plain, &res)
if err != nil {
fmt.Println("unmarshal error")
fmt.Println(err)
}
return res, err
}