← All projects

darvaza.org/x/container

Generic data structure implementations extending Go's standard containers.

Three generic collection types. container/list wraps list.List as a type-safe List[T] with match, filter, and move operations. container/set provides a hash-bucketed, thread-safe Set[K,H,T] keyed by user-supplied hash and match functions.

container/slices implements sorted-slice-backed sets — CustomSet[T] for any type with a custom comparator, and OrderedSet[T] as a convenience for core.Ordered types. All sets support Add, Remove, Contains, ForEach, Clone, and capacity management (Reserve, Grow, Trim).