From 3c42043ab6a0ee776b588998a72fbdbc10ad0dc6 Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Thu, 20 Sep 2018 20:49:57 +0200 Subject: [PATCH] models: Added Equals method to tag model. --- models/tag.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/models/tag.go b/models/tag.go index 8560cb8..a9f37c3 100644 --- a/models/tag.go +++ b/models/tag.go @@ -5,3 +5,8 @@ type Tag struct { Kind TagKind `bson:"kind"` Name string `bson:"name"` } + +// Equal returns true if the tags match one another. +func (tag *Tag) Equal(other Tag) bool { + return tag.Kind == other.Kind && tag.Name == other.Name +}