cant recover my object which has fields of map[string]interface{}
I have tried to register the map[string]interface{} to make it work using
gob.Register(map[string]interface{}{}).
These functions are in an external package if that helps.
Thanks,
func Encode_gob(logs chan string, input interface{}) (bool, []byte) {
if input == nil { logs<-"TOOLS/GOB/ENCODE: INPUT INTERFACE IS NIL"; return
false, nil }
encoded := new(bytes.Buffer)
gob.Register(map[string]interface{}{})
encCache := gob.NewEncoder(encoded)
encCache.Encode(input)
return true, encoded.Bytes()
}
func Decode_gob(logs chan string, input []byte, data interface{}) bool {
dCache := bytes.NewBuffer(input)
gob.Register(map[string]interface{}{})
decCache := gob.NewDecoder(dCache)
e := decCache.Decode(data)
if e != nil || data == nil { logs<-"TOOLS/GOB/DECODE: "+e.Error(); return
false }
return true
}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.