Skip to content

Show a wrapper type with options, correct a claim about Units - #5

Merged
pscheid92 merged 2 commits into
mainfrom
docs-wrapper-and-units
Nov 9, 2026
Merged

pscheid92 merged 2 commits into
mainfrom
docs-wrapper-and-units

Conversation

@pscheid92

Copy link
Copy Markdown
Owner

Findings 8 and 9 of the full review.

  • A wrapper type of one's own. The wrapper types are strict and take no options. The README, the package
    documentation and a new example (ExampleAcceptDays_ownWrapper, a whole-file example, so pkg.go.dev shows the type
    too) show the few lines it takes to give a field AcceptDays or AlsoAccept without passing options to the call.
  • time.ParseDuration. "How it is tested" said Units reads exactly what it reads, with the same value. The list
    of differences further up and the fuzz target say otherwise: fractions may differ by the last nanosecond.

The wrapper types take no options, and nothing said what to do when a
field needs AcceptDays or AlsoAccept and the call cannot take options.
The README and an example now show a wrapper type of one's own.

The README said that Units reads exactly what time.ParseDuration reads,
with the same value, which the list of differences and the fuzz target
itself contradict: fractions may differ by the last nanosecond.
@pscheid92
pscheid92 merged commit 63119c7 into main Nov 9, 2026
19 checks passed
@pscheid92
pscheid92 deleted the docs-wrapper-and-units branch November 9, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant