// Implements proto.MultiBulkParse func floatSliceParser(rd *proto.Reader, n int64) (interface{}, error) { nn := make([]float64, 0, n) for i := int64(0); i < n; i++ { n, err := rd.ReadFloatReply() if err != nil { return nil, err } nn = append(nn, n) } return nn, nil }
func geoPosParser(rd *proto.Reader, n int64) (interface{}, error) { var pos GeoPos var err error pos.Longitude, err = rd.ReadFloatReply() if err != nil { return nil, err } pos.Latitude, err = rd.ReadFloatReply() if err != nil { return nil, err } return &pos, nil }
// Implements proto.MultiBulkParse func zSliceParser(rd *proto.Reader, n int64) (interface{}, error) { zz := make([]Z, n/2) for i := int64(0); i < n; i += 2 { var err error z := &zz[i/2] z.Member, err = rd.ReadStringReply() if err != nil { return nil, err } z.Score, err = rd.ReadFloatReply() if err != nil { return nil, err } } return zz, nil }