summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-06-02 13:57:30 -0400
committerdemo <demo@antix1>2026-06-02 13:57:30 -0400
commit8d70d18f4d64f3b82f148dbd54ac5bd2b1cf0c06 (patch)
treefa32e6e0edbae5cda44537f9b140df1f4a3bf67c
parenta2a3a28b48eea53f4212877c4fbc4fc8d0865f64 (diff)
feat: simplify API to avoid double negativesv0.2.0next-version
-rw-r--r--hamlet.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/hamlet.go b/hamlet.go
index 76cc3b6..de71aca 100644
--- a/hamlet.go
+++ b/hamlet.go
@@ -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