Repository navigation
Conversation
The options of each format are built once at start-up and shared. A call with AlsoAccept or AcceptDays builds new ones, so the documentation says to keep those in a variable. This replaces a table of 768 atomic pointers that made every combination of options free, with the bit set, the format numbers and the tests that served it. BENCHMARKS.md keeps what tests enforce and one table marked as a snapshot, and the README quotes no nanoseconds. The benchmarks are cut to the ones the doc relies on, and the test that pinned exact allocation counts of errors is gone. CI fuzzes in one job instead of a generated matrix. The coverage badge job and the Scorecard workflow are removed, and the README keeps the CI and Go Reference badges. The README and the documentation of Format now give the reasons for three choices: a Format is a name and an invalid one a programming error, exponents are rejected on purpose, and a sign inside an ISO 8601 duration is rejected as the format tag of encoding/json/v2 did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Takes back the parts of the last pull request that were more than the library needs, and removes tooling that was
there for show. 13 files, 832 lines removed, 179 added.
The options cache
The options of each format are built once at start-up and shared. A call with
AlsoAcceptorAcceptDaysbuildsnew ones. Before, a table of 768 atomic pointers, indexed by a bit set of formats, made every combination free.
With(ISO8601)With(ISO8601, AlsoAccept(Nano))So the documentation now says to keep options that have decoding options in a variable, which every example already
did. No release contains the earlier promise.
Gone with the table: the bit set, the numbers of the formats and their test, the option that had to be one byte, and
the tests of first calls and of stored values. What stays the same: the order of the formats in
AlsoAcceptmakes nodifference, error messages name the written format first, and an invalid format panics in
AlsoAccept.Benchmarks
BENCHMARKS.mdgoes from 212 lines to 42: what tests enforce, one table marked as a single measurement, and how tomeasure. The README quotes no nanoseconds.
bench_test.gokeeps the benchmarks the doc relies on, 307 lines instead of 547.library allocates differently.
CI and badges
fuzzjob runsjust fuzzandjust compat-fuzzin place of a job that listed the targets and a matrix ofseven. It keeps the cache of found inputs and the upload of a failing input. The targets now run one after the
other: about five minutes on a push, about 70 at night.
SECURITY.mdand CodeQL stay.None of the removed jobs is a required check.
Reasons in the docs
Formatis a name, so that a flag or a configuration can hold one, and an invalid one is a programming error,like
time.Month(13).PT-30S, is rejected as theformattag ofencoding/json/v2did. Checked against that code: it rejects
PT-30SandP-1Dand reads a leading sign.No behaviour of decoding or encoding changes.
Checks
just checkpasses, with 100% statement coverage.go vetpasses forlinux/386.just mutate: no change survives. The last run had 11 timeouts on a loaded machine; two of them, applied by hand,fail the tests within two seconds.
fuzzjob has only run throughactionlintand the recipes locally. This pull request is its first run.After the merge, the
badgesbranch is unused and can be deleted.