sets

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package sets provides utilities to manipulate sets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sets

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

Sets is a set of items.

func NewSets

func NewSets[T comparable](items ...T) Sets[T]

NewSets creates a Sets from a list of values.

func (Sets[T]) Clear

func (s Sets[T]) Clear()

Clear empties the set.

func (Sets[T]) Delete

func (s Sets[T]) Delete(items ...T)

Delete removes all items from the set.

func (Sets[T]) Has

func (s Sets[T]) Has(item T) bool

Has returns true if and only if item is contained in the set.

func (Sets[T]) Insert

func (s Sets[T]) Insert(items ...T)

Insert adds items to the set.

func (Sets[T]) Len

func (s Sets[T]) Len() int

Len returns the size of the set.

Jump to

Keyboard shortcuts

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