diff options
Diffstat (limited to 'identity/identity.go')
| -rw-r--r-- | identity/identity.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/identity/identity.go b/identity/identity.go index 1ae13c6..06bd421 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -7,6 +7,10 @@ type Identity struct { Reduced string } +func (i Identity) I(other Identity) bool { + return i.Reduced == other.Reduced +} + func (i Identity) Is(input string) bool { reduced := Reduce(input) return i.Reduced == reduced @@ -23,6 +27,7 @@ func New(input string) Identity { func Reduce(input string) string { reduced := input + reduced = strings.TrimPrefix(input, ".") if !strings.HasPrefix(reduced, ".") { reduced = strings.Split(reduced, ".")[0] } |
