set

package
v1.13.14-0.3.0.rc.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package set provides a generic implementation of a set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[T comparable] map[T]struct{}

A Set is a generic set implementation.

func From

func From[T comparable](elements ...T) Set[T]

From returns a Set containing the elements.

func (Set[T]) Intersect

func (s Set[T]) Intersect(t Set[T]) Set[T]

Intersect returns the intersection of `s` and `t`.

func (Set[T]) Slice

func (s Set[T]) Slice() []T

Slice returns the elements of `s` as a slice.

func (Set[T]) Sub

func (s Set[T]) Sub(t Set[T]) Set[T]

Sub returns the elements in `s` that aren't in `t`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL