Skip to content

Commit d31567a

Browse files
committed
TL string encoder
1 parent 8f0f12a commit d31567a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tl/encoder.go

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func Marshal(o any) ([]byte, error) {
4545
binary.BigEndian.PutUint32(b, 0x379779bc) // false
4646
}
4747
return b, nil
48+
case reflect.String:
49+
data := []byte(val.String())
50+
b := append(EncodeLength(len(data)), data...)
51+
return zeroPadding(b), nil
4852
case reflect.Slice:
4953
if val.Type().Elem().Kind() != reflect.Uint8 {
5054
return encodeVector(val)

0 commit comments

Comments
 (0)