Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fail ¶
Fail logs an error message indicating a failed assertion. It works the same as That, but does not require a condition.
func That ¶
That performs a soft assertion by logging an error if the given condition is false. It is meant to indicate a condition that are always expected to be true. Returns true if the condition is met, otherwise false.
Example: softassert.That(logger, object.state == "ready", "object is not ready")
Best practices: - Use it to check for programming errors and invariants. - Use it to communicate assumptions about the code. - Use it to abort or recover from an unexpected state. - Never use it as a substitute for regular error handling, validation, or control flow.
Types ¶
This section is empty.