This release adds 4 new functions: UnmarshalFirst, Diagnose, DiagnoseFirst, and Wellformed. In addition Valid function is deprecated (use Wellformed instead).
UnmarshalFirstdecodes first CBOR data item and returns remaining bytes. This is useful for CBOR Sequences (RFC 8742) and also becauseUnmarshalwas fixed in v2.5.0-beta to returnExtraneousDataErrorif there are remaining bytes.DiagnoseandDiagnoseFirstreturns human-readable Extended Diagnostic Notation (RFC 8610 Appendix G) for the given CBOR encoding. These are useful for debugging and allows more user-friendly error logging.
What's Changed (since v2.5.0-beta2)
- Deprecate Valid() and add Wellformed() to replace it by @fxamacker in https://github.com/fxamacker/cbor/pull/400
- Add UnmarshalFirst by @immesys in https://github.com/fxamacker/cbor/pull/398
- Add UnmarshalFirst to DecMode interface by @fxamacker in https://github.com/fxamacker/cbor/pull/402
- Add functions for Extended Diagnostic Notation (RFC 8610 Appendix G) by @zensh in https://github.com/fxamacker/cbor/pull/386
- Add more tests for Diagnose and DiagnoseFirst by @fxamacker in https://github.com/fxamacker/cbor/pull/405
Changes to CI and Documentation
- Create govulncheck.yml by @fxamacker in https://github.com/fxamacker/cbor/pull/393
- Update README for cbor v2.5.0-beta2 by @fxamacker in https://github.com/fxamacker/cbor/pull/394
- Bump actions/setup-go from 3 to 4 by @dependabot in https://github.com/fxamacker/cbor/pull/395
- Update ci-go-cover.yml by @x448 in https://github.com/fxamacker/cbor/pull/404
- Update README for CBOR Sequences RFC 8742 by @fxamacker in https://github.com/fxamacker/cbor/pull/406
- Update README.md for v2.5.0-beta3 by @fxamacker in https://github.com/fxamacker/cbor/pull/407
Special Thanks
Thank you @immesys, @zensh, and @x448 for your contributions!
Full Changelog: https://github.com/fxamacker/cbor/compare/v2.5.0-beta2...v2.5.0-beta3