From c52d8702b283708c7fa6fb144ea0911283e4d5bb Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 9 Aug 2018 09:58:40 -0400 Subject: [PATCH] Do not save Var.Time to the database. --- persist.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/persist.go b/persist.go index 2b0bca1..f8e70bb 100644 --- a/persist.go +++ b/persist.go @@ -28,6 +28,10 @@ type Var struct { opt Option } +type encVar struct { + X interface{} +} + type Option struct { Permanent bool } @@ -224,12 +228,13 @@ type encoded struct { func encode(p *Var,chs ...chan struct{}) encoded { ret := encoded{name:[]byte(p.name)} + ep := encVar{ p.X } if len(chs) > 0 { ret.donech = chs[0] } var buf bytes.Buffer enc := gob.NewEncoder(&buf) - err := enc.Encode(*p) + err := enc.Encode(ep) if err != nil { fmt.Println("encode(): ",err) }