From 6114247d0ab8cc527f513b6b01721891311a8680 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 28 Jul 2023 13:49:04 -0700 Subject: [PATCH] types/logid: add a Compare method Updates #cleanup Signed-off-by: David Anderson --- types/logid/id.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/logid/id.go b/types/logid/id.go index f3d705f18..92c1a021e 100644 --- a/types/logid/id.go +++ b/types/logid/id.go @@ -84,7 +84,11 @@ func (id PublicID) String() string { } func (id1 PublicID) Less(id2 PublicID) bool { - return slices.Compare(id1[:], id2[:]) < 0 + return id1.Compare(id2) < 0 +} + +func (id1 PublicID) Compare(id2 PublicID) int { + return slices.Compare(id1[:], id2[:]) } func (id PublicID) IsZero() bool {