This commit is contained in:
techknowlogick 2020-03-20 10:29:31 -04:00 committed by GitHub
parent e5a008f7b2
commit 2fa1078911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 177 additions and 34 deletions

View file

@ -474,8 +474,8 @@ func AppendExtension(b []byte, e Extension) ([]byte, error) {
// and returns any remaining bytes.
// Possible errors:
// - ErrShortBytes ('b' not long enough)
// - ExtensionTypeErorr{} (wire type not the same as e.Type())
// - TypeErorr{} (next object not an extension)
// - ExtensionTypeError{} (wire type not the same as e.Type())
// - TypeError{} (next object not an extension)
// - InvalidPrefixError
// - An umarshal error returned from e.UnmarshalBinary
func ReadExtensionBytes(b []byte, e Extension) ([]byte, error) {

View file

@ -201,14 +201,14 @@ func ReadMapHeaderBytes(b []byte) (sz uint32, o []byte, err error) {
// - ErrShortBytes (too few bytes)
// - TypeError{} (not a str or bin)
func ReadMapKeyZC(b []byte) ([]byte, []byte, error) {
o, b, err := ReadStringZC(b)
o, x, err := ReadStringZC(b)
if err != nil {
if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType {
return ReadBytesZC(b)
}
return nil, b, err
}
return o, b, nil
return o, x, nil
}
// ReadArrayHeaderBytes attempts to read