Help us shape the future of Go! Take the 2026 Go Developer Survey

structures

package
v0.12.19 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[K comparable] struct {
	// contains filtered or unexported fields
}

Set tracks unique values of type K backed by a map for O(1) lookups.

func NewSet added in v0.12.17

func NewSet[K comparable]() *Set[K]

NewSet creates an empty Set with an initialized backend map.

func (*Set[K]) Add

func (s *Set[K]) Add(val K) error

Add inserts a value into the set and raises an error if it already exists.

func (*Set[K]) Contains

func (s *Set[K]) Contains(val K) bool

Contains reports whether val is currently a member of the set.

Source Files

  • Set.go

Jump to

Keyboard shortcuts

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