We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4abf91e commit 642c9ddCopy full SHA for 642c9dd
data/encode.go
@@ -151,7 +151,8 @@ func encodeByteString(bs *ByteString) (any, error) {
151
// The Rust code shows special handling for byte strings longer than 64 bytes
152
// using indefinite-length encoding, but the Go CBOR library handles this automatically
153
// when using cbor.Marshal, so we can just return the bytes directly
154
- return bs.Inner, nil
+ // NOTE: we use cbor.ByteString to allow it to be used as a map key
155
+ return cbor.ByteString(string(bs.Inner)), nil
156
}
157
158
// encodeList encodes a List to CBOR array format.
0 commit comments