package proto

import (
	
	
	

	
)

func ( []byte,  interface{}) error {
	switch v := .(type) {
	case nil:
		return fmt.Errorf("redis: Scan(nil)")
	case *string:
		* = util.BytesToString()
		return nil
	case *[]byte:
		* = 
		return nil
	case *int:
		var  error
		*,  = util.Atoi()
		return 
	case *int8:
		,  := util.ParseInt(, 10, 8)
		if  != nil {
			return 
		}
		* = int8()
		return nil
	case *int16:
		,  := util.ParseInt(, 10, 16)
		if  != nil {
			return 
		}
		* = int16()
		return nil
	case *int32:
		,  := util.ParseInt(, 10, 32)
		if  != nil {
			return 
		}
		* = int32()
		return nil
	case *int64:
		,  := util.ParseInt(, 10, 64)
		if  != nil {
			return 
		}
		* = 
		return nil
	case *uint:
		,  := util.ParseUint(, 10, 64)
		if  != nil {
			return 
		}
		* = uint()
		return nil
	case *uint8:
		,  := util.ParseUint(, 10, 8)
		if  != nil {
			return 
		}
		* = uint8()
		return nil
	case *uint16:
		,  := util.ParseUint(, 10, 16)
		if  != nil {
			return 
		}
		* = uint16()
		return nil
	case *uint32:
		,  := util.ParseUint(, 10, 32)
		if  != nil {
			return 
		}
		* = uint32()
		return nil
	case *uint64:
		,  := util.ParseUint(, 10, 64)
		if  != nil {
			return 
		}
		* = 
		return nil
	case *float32:
		,  := util.ParseFloat(, 32)
		if  != nil {
			return 
		}
		* = float32()
		return 
	case *float64:
		var  error
		*,  = util.ParseFloat(, 64)
		return 
	case *bool:
		* = len() == 1 && [0] == '1'
		return nil
	case encoding.BinaryUnmarshaler:
		return .UnmarshalBinary()
	default:
		return fmt.Errorf(
			"redis: can't unmarshal %T (consider implementing BinaryUnmarshaler)", )
	}
}

func ( []string,  interface{}) error {
	 := reflect.ValueOf()
	if !.IsValid() {
		return fmt.Errorf("redis: ScanSlice(nil)")
	}
	if .Kind() != reflect.Ptr {
		return fmt.Errorf("redis: ScanSlice(non-pointer %T)", )
	}
	 = .Elem()
	if .Kind() != reflect.Slice {
		return fmt.Errorf("redis: ScanSlice(non-slice %T)", )
	}

	 := makeSliceNextElemFunc()
	for ,  := range  {
		 := ()
		if  := Scan([]byte(), .Addr().Interface());  != nil {
			 = fmt.Errorf("redis: ScanSlice index=%d value=%q failed: %s", , , )
			return 
		}
	}

	return nil
}

func ( reflect.Value) func() reflect.Value {
	 := .Type().Elem()

	if .Kind() == reflect.Ptr {
		 = .Elem()
		return func() reflect.Value {
			if .Len() < .Cap() {
				.Set(.Slice(0, .Len()+1))
				 := .Index(.Len() - 1)
				if .IsNil() {
					.Set(reflect.New())
				}
				return .Elem()
			}

			 := reflect.New()
			.Set(reflect.Append(, ))
			return .Elem()
		}
	}

	 := reflect.Zero()
	return func() reflect.Value {
		if .Len() < .Cap() {
			.Set(.Slice(0, .Len()+1))
			return .Index(.Len() - 1)
		}

		.Set(reflect.Append(, ))
		return .Index(.Len() - 1)
	}