boj/redistore · redistore.go
go logo
func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error {
	dec := gob.NewDecoder(bytes.NewBuffer(d))
	return dec.Decode(&ss.Values)
}
Similar code snippets
1.
boj/redistore · redistore.go
Match rating: 61.11% · See similar code snippets
go logo
func (s JSONSerializer) Deserialize(d []byte, ss *sessions.Session) error {
	m := make(map[string]interface{})
	err := json.Unmarshal(d, &m)
	if err != nil {
		fmt.Printf("redistore.JSONSerializer.deserialize() Error: %v", err)
		return err
	}
	for k, v := range m {
		ss.Values[k] = v
	}
	return nil
}
2.
asdine/storm · gob.go
Match rating: 59.44% · See similar code snippets
go logo
func (c gobCodec) Unmarshal(b []byte, v interface{}) error {
	r := bytes.NewReader(b)
	dec := gob.NewDecoder(r)
	return dec.Decode(v)
}
3.
kataras/iris · gob.go
Match rating: 58.92% · See similar code snippets
go logo
func GobDecode(b []byte) (store Store, err error) {
	dec := gob.NewDecoder(bytes.NewBuffer(b))
	// no reference because of:
	// gob: decoding into local type *memstore.Store, received remote type Entry
	err = dec.Decode(&store)
	return
}
4.
webx-top/com · string.go
Match rating: 58.77% · See similar code snippets
go logo
func GobDecode(data []byte, to interface{}) error {
	buf := bytes.NewBuffer(data)
	dec := gob.NewDecoder(buf)
	return dec.Decode(to)
}
5.
fcavani/log · storeboltdb.go
Match rating: 58.54% · See similar code snippets
go logo
func (g *Gob) Decode(b []byte) (interface{}, error) {
	buf := bytes.NewBuffer(b)
	dec := gob.NewDecoder(buf)
	val := types.Make(types.Type(g.TypeName))
	err := dec.DecodeValue(val)
	if err != nil {
		return nil, e.New(err)
	}
	return val.Interface(), nil
}
6.
vibhavp/amqp-rpc · codec.go
Match rating: 58.37% · See similar code snippets
go logo
func (GobCodec) Unmarshal(data []byte, v interface{}) error {
	body := bytes.NewBuffer(data)
	dec := gob.NewDecoder(body)
	err := dec.Decode(v)
	return err
}
7.
kataras/iris · gob.go
Match rating: 57.85% · See similar code snippets
go logo
func GobDecodeEntry(b []byte) (entry Entry, err error) {
	dec := gob.NewDecoder(bytes.NewBuffer(b))
	err = dec.Decode(&entry)
	return
}
8.
clarkduvall/hyperloglog · hyperloglog.go
Match rating: 56.24% · See similar code snippets
go logo
func (h *HyperLogLog) GobDecode(b []byte) error {
	dec := gob.NewDecoder(bytes.NewBuffer(b))
	if err := dec.Decode(&h.reg); err != nil {
		return err
	}
	if err := dec.Decode(&h.m); err != nil {
		return err
	}
	if err := dec.Decode(&h.p); err != nil {
		return err
	}
	return nil
}
9.
albrow/zoom · marshal.go
Match rating: 55.79% · See similar code snippets
go logo
func (gobMarshalerUnmarshaler) Unmarshal(data []byte, v interface{}) error {
	buff := bytes.NewBuffer(data)
	dec := gob.NewDecoder(buff)
	if err := dec.Decode(v); err != nil {
		return err
	}
	return nil
}
10.
tyler-smith/go-bip32 · bip32.go
Match rating: 55.22% · See similar code snippets
go logo
func B58Deserialize(data string) (*Key, error) {
	b, err := base58Decode(data)
	if err != nil {
		return nil, err
	}
	return Deserialize(b)
}