From a927b9519e6569e81b64c209791a1ea0f9bbd6e6 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 23 May 2025 00:03:39 -0400 Subject: [PATCH] tape: Update tape.String to include ~[]byte --- tape/types.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tape/types.go b/tape/types.go index 448e0cf..70ba3a2 100644 --- a/tape/types.go +++ b/tape/types.go @@ -1,6 +1,9 @@ // Package tape implements Table Pair Encoding. package tape +// TODO: in math/rand: uint is capitalized like Uint, we need to replicate that +// here + import "fmt" // encoding and decoding functions must not make any allocations @@ -31,7 +34,7 @@ type Int64 interface { ~uint64 | ~int64 } // UInt is any unsigned integer. type UInt interface { ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 } // String is any string. -type String interface { ~string } +type String interface { ~string | ~[]uint8 } // DecodeI8 decodes an 8 bit integer from the given data. func DecodeI8[T Int8](data []byte) (value T, n int, err error) {