Register types with encoding/gob. Rewrite test/basic.

This commit is contained in:
gmp
2018-08-03 15:14:10 -04:00
parent b880a5671d
commit 8f78a6c6d2
3 changed files with 28 additions and 15 deletions
+2
View File
@@ -2,6 +2,7 @@ package main
const template string = `package main
import (
"encoding/gob"
"time"
"unsafe"
"gitlab.wow.st/gmp/persist"
@@ -11,6 +12,7 @@ type Var_N persist.Var
func New(name string, xs ..._T) *Var_N {
var x _T
gob.Register(x)
if len(xs) > 0 {
x = xs[0]
}