syncset

package
v1.15.0 Latest Latest
Warning

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

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

Documentation

Overview

Package syncset provides a simple, mutex-protected set for strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set is a concurrency-safe set of strings.

func New

func New() *Set

New returns an initialized, empty Set.

func (*Set) AddIfAbsent

func (s *Set) AddIfAbsent(str string) bool

AddIfAbsent adds str to the set if it is not already present, and reports whether it was added.

func (*Set) Elements

func (s *Set) Elements() []string

Elements returns a slice of all elements in the set.

Jump to

Keyboard shortcuts

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