Documentation ¶
Overview ¶
The unique package provides facilities for canonicalizing ("interning") comparable values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle[T comparable] struct { // contains filtered or unexported fields }
Handle is a globally unique identity for some value of type T.
Two handles compare equal exactly if the two values used to create the handles would have also compared equal. The comparison of two handles is trivial and typically much more efficient than comparing the values used to create them.
func Make ¶
func Make[T comparable](value T) Handle[T]
Make returns a globally unique handle for a value of type T. Handles are equal if and only if the values used to produce them are equal.
Click to show internal directories.
Click to hide internal directories.