feat(ksuid): add Equal and IsZero for ApplyInterfacePtr
StringKSUID and BinaryKSUID now implement ApplyInterface with nil-nil equality semantics, enabling ApplyInterfacePtr in patch logic. Adds nil sentinel vars and tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -28,3 +28,10 @@ const (
|
||||
ksuidBinaryLength = 20
|
||||
ksuidStringLength = 27
|
||||
)
|
||||
|
||||
func equalKSUID(lh, rh ksuid.KSUID) bool {
|
||||
if lh.IsNil() && rh.IsNil() {
|
||||
return true
|
||||
}
|
||||
return lh.String() == rh.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user