Skip to content

Commit 6114247

Browse files
committed
types/logid: add a Compare method
Updates #cleanup Signed-off-by: David Anderson <[email protected]>
1 parent 52212f4 commit 6114247

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

types/logid/id.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ func (id PublicID) String() string {
8484
}
8585

8686
func (id1 PublicID) Less(id2 PublicID) bool {
87-
return slices.Compare(id1[:], id2[:]) < 0
87+
return id1.Compare(id2) < 0
88+
}
89+
90+
func (id1 PublicID) Compare(id2 PublicID) int {
91+
return slices.Compare(id1[:], id2[:])
8892
}
8993

9094
func (id PublicID) IsZero() bool {

0 commit comments

Comments
 (0)