Register types with encoding/gob. Rewrite test/basic.
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user