From ac95b87e7c67c730edf34809646aca5a76b13eda Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Fri, 7 Jul 2023 08:47:30 +0300 Subject: [PATCH] [#101] Add `Equals` for `Address` Signed-off-by: Anton Nikiforov --- object/id/address.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/object/id/address.go b/object/id/address.go index 1f3a864..6d5f12a 100644 --- a/object/id/address.go +++ b/object/id/address.go @@ -169,3 +169,11 @@ func (x *Address) DecodeString(s string) error { func (x Address) String() string { return x.EncodeToString() } + +// Equals defines a comparison relation between two Address's instances. +// +// Note that comparison using '==' operator is not recommended since it MAY result +// in loss of compatibility. +func (x Address) Equals(other Address) bool { + return x.obj.Equals(other.obj) && x.cnr.Equals(other.cnr) +}