mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
feat: add WriteArg and Scan net.IP(#2062)
* feat: add WriteArg net.IP * feat: add Scan net.IP
This commit is contained in:
@ -3,6 +3,7 @@ package proto
|
||||
import (
|
||||
"encoding"
|
||||
"fmt"
|
||||
"net"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
@ -115,6 +116,9 @@ func Scan(b []byte, v interface{}) error {
|
||||
return nil
|
||||
case encoding.BinaryUnmarshaler:
|
||||
return v.UnmarshalBinary(b)
|
||||
case *net.IP:
|
||||
*v = b
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf(
|
||||
"redis: can't unmarshal %T (consider implementing BinaryUnmarshaler)", v)
|
||||
|
Reference in New Issue
Block a user