Unmarshal parses the gob-encoded data "b" and stores the result in the value pointed to by "outPtr".
(b []byte, outPtr interface{})
| 112 | // Unmarshal parses the gob-encoded data "b" and stores the result |
| 113 | // in the value pointed to by "outPtr". |
| 114 | func (GobTranscoder) Unmarshal(b []byte, outPtr interface{}) error { |
| 115 | dec := gob.NewDecoder(bytes.NewBuffer(b)) |
| 116 | |
| 117 | if v, ok := outPtr.(reflect.Value); ok { |
| 118 | return dec.DecodeValue(v) |
| 119 | } |
| 120 | |
| 121 | return dec.Decode(outPtr) |
| 122 | } |