Skip to content

Commit

Permalink
encoder: Reflectionless fast path for encoding RawMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jille committed Nov 2, 2023
1 parent 19c91df commit 48fe046
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func (e *Encoder) Encode(v interface{}) error {
return e.encodeInt64Cond(int64(v))
case time.Time:
return e.EncodeTime(v)
case RawMessage:
return e.write([]byte(v))
}
return e.EncodeValue(reflect.ValueOf(v))
}
Expand Down

0 comments on commit 48fe046

Please sign in to comment.