Пример #1
0
func (o *stringRow) loadObjectValue(r storeReader) (interface{}, error) {
	_, err := o.LoadDataValue(r)
	if err != nil {
		return nil, errors.Trace(err)
	}

	return rdb.String(o.Value), nil
}
Пример #2
0
func (s *testStoreSuite) xslotsrestore(c *C, db uint32, args ...interface{}) {
	x := []interface{}{}
	for i, a := range args {
		switch i % 3 {
		case 0, 1:
			x = append(x, a)
		case 2:
			dump, err := rdb.EncodeDump(rdb.String([]byte(a.(string))))
			c.Assert(err, IsNil)

			x = append(x, dump)
		}
	}

	err := s.s.SlotsRestore(db, FormatBytes(x...))
	c.Assert(err, IsNil)
}