set

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package set provides generic set data structure implementations.

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{}

Set represents a set data structure.

func New

func New[T comparable](items ...T) Set[T]

New returns an initialized set.

func (Set[T]) Add

func (s Set[T]) Add(item T)

Add adds item into the set s.

func (Set[T]) Contains

func (s Set[T]) Contains(item T) bool

Contains returns true if the set s contains item.

Jump to

Keyboard shortcuts

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