What's Changed
Latest changes (among many) include cbor.MarshalToBuffer() and UserBufferEncMode interface to support user specified buffer (alternative to built-in buffer pool). This was going to be a release candidate but recent improvements (June 9, 2024) needs fuzzing, etc.
Special thanks to @benluddy for contributing features, optimizations, improvements, bug fixes, and discussions! :+1:
⭐ Features and Optimizations
- Add decoding option TimeTagToAny to produce RFC3339 when decoding time into interface{} by @ssuriyan7 in https://github.com/fxamacker/cbor/pull/506
- Bypass sorting overhead for single-entry maps. by @benluddy in https://github.com/fxamacker/cbor/pull/516
- Add decode option to allow rejecting inputs that contain certain simple values. by @benluddy in https://github.com/fxamacker/cbor/pull/481
- Allow rejection of NaN and Inf float values on encode and decode. by @benluddy in https://github.com/fxamacker/cbor/pull/513
- Add SortMode to encode struct fields in a less predictable order. by @benluddy in https://github.com/fxamacker/cbor/pull/515
- Add a decoding option to allow decoding byte string into time.Time. by @benluddy in https://github.com/fxamacker/cbor/pull/524
- Encode structs directly to output buffer. by @benluddy in https://github.com/fxamacker/cbor/pull/519
- Support automatic conversion between text and binary string representations by @benluddy in https://github.com/fxamacker/cbor/pull/476
- Add a method for marshaling directly into a user-provided buffer. by @benluddy in https://github.com/fxamacker/cbor/pull/521
- Add options to disable BinaryMarshaler/BinaryUnmarshaler support. by @benluddy in https://github.com/fxamacker/cbor/pull/526
- Add option to reject decoding bignum tags and encoding big.Int. by @benluddy in https://github.com/fxamacker/cbor/pull/527
- Improve speed & memory use for Diagnose() and DiagnoseFirst() by @benluddy in https://github.com/fxamacker/cbor/pull/533
- Refactor sorted map encode to use fewer buffers for nested maps. by @benluddy in https://github.com/fxamacker/cbor/pull/537
- Allow user to specify buffer by adding
cbor.MarshalToBuffer(),UserBufferEncModeinterface, etc. by @fxamacker in https://github.com/fxamacker/cbor/pull/553
🛠 Improvements
Improvements focused on fixing or updating new features. For bug fixes to features that were already released, see :lady_beetle: Bug Fixes.
- Refactor to reuse functions and improve code coverage by @fxamacker in https://github.com/fxamacker/cbor/pull/531
- Fix invalid RFC 3339 in TimeTagToAny (unreleased new feature) by @benluddy in https://github.com/fxamacker/cbor/pull/540
- Refactor and improve code by @fxamacker in https://github.com/fxamacker/cbor/pull/542
- Use "cbor:" prefixed error msg when decoding with non-default TimeTagToAnyMode setting by @fxamacker in https://github.com/fxamacker/cbor/pull/544
- Disable conflicting encode options when marshaling cbor.Tag. by @benluddy in https://github.com/fxamacker/cbor/pull/546
- Improve byte string format decoding options by @fxamacker in https://github.com/fxamacker/cbor/pull/550
- Replace
*errors.errorStringwithInadmissibleTagContentTypeErrorby @fxamacker in https://github.com/fxamacker/cbor/pull/552 - Rename ByteSliceMode to ByteSliceLaterFormatMode, etc by @fxamacker in https://github.com/fxamacker/cbor/pull/554
🐞 Bug Fixes
- Check well-formedness of data from MarshalCBOR by @fxamacker in https://github.com/fxamacker/cbor/pull/485
- Treat map keys matching the same struct field as duplicates. by @benluddy in https://github.com/fxamacker/cbor/pull/492
- Decouple time.Time parsing from empty interface behavior. by @benluddy in https://github.com/fxamacker/cbor/pull/503
Other changes
Details
- Bump govulncheck from v1.0.1 to v1.0.4 by @fxamacker in https://github.com/fxamacker/cbor/pull/493
- Remove OpenSSF Scorecard until scorecard bug is fixed by @x448 in https://github.com/fxamacker/cbor/pull/495
- Bump github/codeql-action from 3.24.0 to 3.24.5 by @dependabot in https://github.com/fxamacker/cbor/pull/498
- Bump github/codeql-action from 3.24.5 to 3.24.6 by @dependabot in https://github.com/fxamacker/cbor/pull/502
- Enable more linters in .golangci.yml by @fxamacker in https://github.com/fxamacker/cbor/pull/504
- Bump actions/checkout from 4.1.1 to 4.1.2 by @dependabot in https://github.com/fxamacker/cbor/pull/509
- Bump github/codeql-action from 3.24.6 to 3.24.7 by @dependabot in https://github.com/fxamacker/cbor/pull/510
- Bump github/codeql-action from 3.24.7 to 3.24.9 by @dependabot in https://github.com/fxamacker/cbor/pull/511
- Bump github/codeql-action from 3.24.9 to 3.24.10 by @dependabot in https://github.com/fxamacker/cbor/pull/518
- Bump actions/checkout from 4.1.2 to 4.1.3 by @dependabot in https://github.com/fxamacker/cbor/pull/522
- Bump github/codeql-action from 3.24.10 to 3.25.1 by @dependabot in https://github.com/fxamacker/cbor/pull/523
- Bump github/codeql-action from 3.25.1 to 3.25.3 by @dependabot in https://github.com/fxamacker/cbor/pull/529
- Bump actions/checkout from 4.1.3 to 4.1.4 by @dependabot in https://github.com/fxamacker/cbor/pull/530
- Bump actions/setup-go from 4.1.0 to 5.0.1 by @dependabot in https://github.com/fxamacker/cbor/pull/532
- Bump github/codeql-action from 3.25.3 to 3.25.4 by @dependabot in https://github.com/fxamacker/cbor/pull/534
- Bump actions/checkout from 4.1.4 to 4.1.5 by @dependabot in https://github.com/fxamacker/cbor/pull/535
- Bump actions/checkout from 4.1.5 to 4.1.6 by @dependabot in https://github.com/fxamacker/cbor/pull/538
- Bump github/codeql-action from 3.25.4 to 3.25.5 by @dependabot in https://github.com/fxamacker/cbor/pull/539
- Bump golangci-lint from 1.53.3 to 1.54.2 by @fxamacker in https://github.com/fxamacker/cbor/pull/543
- Bump github/codeql-action from 3.25.5 to 3.25.6 by @dependabot in https://github.com/fxamacker/cbor/pull/541
- Bump github/codeql-action from 3.25.6 to 3.25.7 by @dependabot in https://github.com/fxamacker/cbor/pull/547
- Bump golangci-lint to 1.56.2 by @fxamacker in https://github.com/fxamacker/cbor/pull/548
Full Changelog
Full Changelog: https://github.com/fxamacker/cbor/compare/v2.6.0...v2.7.0-beta