Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/proto/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,20 @@ func (w *Writer) WriteArg(v interface{}) error {
return w.int(0)
}
return w.int(v.Nanoseconds())
case net.IP:
return w.bytes(v)
case encoding.TextMarshaler:
b, err := v.MarshalText()
if err != nil {
return err
}
return w.bytes(b)
case encoding.BinaryMarshaler:
b, err := v.MarshalBinary()
if err != nil {
return err
}
return w.bytes(b)
case net.IP:
return w.bytes(v)
default:
return fmt.Errorf(
"redis: can't marshal %T (implement encoding.BinaryMarshaler)", v)
Expand Down
Loading