diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-22 18:29:37 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-22 18:29:37 +0200 |
| commit | 374ed5e1a4dc635c42e33e4133729d40cf3e0e35 (patch) | |
| tree | 01f12ca3eea0154b61afde3d1ee27df2094644e1 /identity | |
| parent | ee481fa406bb685a16d8b568fca0c9f592c06180 (diff) | |
work on tests
also replace the annoying search return with a struct
Diffstat (limited to 'identity')
| -rw-r--r-- | identity/identity.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/identity/identity.go b/identity/identity.go index ee4dfea..1ae13c6 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -8,13 +8,15 @@ type Identity struct { } func (i Identity) Is(input string) bool { - return Reduce(input) == i.Reduced + reduced := Reduce(input) + return i.Reduced == reduced } func New(input string) Identity { + reduced := Reduce(input) return Identity{ Full: input, - Reduced: Reduce(input), + Reduced: reduced, } } |
