diff options
Diffstat (limited to 'rlp/encode.go')
-rw-r--r-- | rlp/encode.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rlp/encode.go b/rlp/encode.go index a0531af01..2aeee4721 100644 --- a/rlp/encode.go +++ b/rlp/encode.go @@ -354,6 +354,8 @@ var ( func makeWriter(typ reflect.Type) (writer, error) { kind := typ.Kind() switch { + case typ == rawValueType: + return writeRawValue, nil case typ.Implements(encoderInterface): return writeEncoder, nil case kind != reflect.Ptr && reflect.PtrTo(typ).Implements(encoderInterface): @@ -389,6 +391,11 @@ func isByte(typ reflect.Type) bool { return typ.Kind() == reflect.Uint8 && !typ.Implements(encoderInterface) } +func writeRawValue(val reflect.Value, w *encbuf) error { + w.str = append(w.str, val.Bytes()...) + return nil +} + func writeUint(val reflect.Value, w *encbuf) error { i := val.Uint() if i == 0 { |