setutil

package
v0.80.8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 0 Imported by: 0

README

setutil Package

The setutil package provides utility functions for working with sets implemented as map[K]struct{}.

Overview

All functions in this package are pure: they never modify their input. They are generic and work with any comparable key type using Go's type-parameter syntax.

Public API

Functions
Function Signature Description
Contains func Contains[K comparable](set map[K]struct{}, key K) bool Reports whether key is present in set

Usage Examples

import "github.com/github/gh-aw/pkg/setutil"

// Check membership in a string set
seen := map[string]struct{}{"foo": {}, "bar": {}}
if setutil.Contains(seen, "foo") {
    // ...
}

Documentation

Overview

Package setutil provides utility functions for working with sets implemented as map[K]struct{}.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[K comparable](set map[K]struct{}, key K) bool

Contains reports whether key is present in a set built as map[K]struct{}.

Types

This section is empty.

Jump to

Keyboard shortcuts

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