diff options
| author | demo <demo@antix1> | 2026-06-02 13:57:30 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-06-02 13:57:30 -0400 |
| commit | 8d70d18f4d64f3b82f148dbd54ac5bd2b1cf0c06 (patch) | |
| tree | fa32e6e0edbae5cda44537f9b140df1f4a3bf67c | |
| parent | a2a3a28b48eea53f4212877c4fbc4fc8d0865f64 (diff) | |
feat: simplify API to avoid double negativesv0.2.0next-version
| -rw-r--r-- | hamlet.go | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -10,18 +10,10 @@ func (a Assertion) Assert() bool { return a.truth } -func (a Assertion) Deny() bool { - return !a.truth -} - -func Present(v any) Assertion { +func New(v any) Assertion { return Assertion{!reflect.ValueOf(v).IsZero()} } -func Absent(v any) Assertion { - return Assertion{reflect.ValueOf(v).IsZero()} -} - // Not computes ~a, given assertion a. func Not(a Assertion) Assertion { negation := !a.truth |
