Documentation
¶
Overview ¶
Package invariant is the module's one assertion primitive (Power of Ten rule 5: assertions stay in production and have a recovery action).
Check has two behaviours selected by build tag:
- with the tag softmagic_assert (every test, fuzz and CI run) a failed check panics with the message, so a violated invariant is a found bug;
- without it (release) Check returns the condition, and the caller takes the recovery action: an error from Compile, or the entry under evaluation abandoned with Truncated: "invariant".
Conditions passed to Check must be side-effect free.
Index ¶
Constants ¶
View Source
const Enabled = false
Enabled reports whether a failed Check panics in this build.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.