go get github.com/lokhman/godat
import "github.com/lokhman/godat"
func main() {
var anyData = ...
var unserializedData ...
serializedBytes, err := godat.Marshal(anyData)
if err != nil {
panic(err)
}
err = godat.Unmarshal(serializedBytes, &unserializedData)
if err != nil {
panic(err)
}
// anyData == unserializedData
}
Use go test
for testing.
Library is available under the MIT license. The included LICENSE file describes this in detail.