# deckarep/golang-set

A simple, battle-tested and generic set type for the Go language. Trusted by GoogleCloudPlatform, Docker, 1Password, Ethereum and Hashicorp.

Repository: https://github.com/deckarep/golang-set
Canonical: https://ross.abutalabs.com/products/golang-set
Language: Go
License: NOASSERTION
License Family: other
Topics: go, set, threadsafe, datastructures, concurrency, golang, generics
Last push: 2026-06-27T15:23:47+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 89, release rhythm 48, longevity 100
- inputs: {"age_days": 4809, "days_push": 67, "days_rel": 135, "gap_med": 251.0, "n_releases_24m": 3}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4700, forks 290 (observed 2026-08-28T04:08:57.176397+00:00)

## What it is
A generic, battle-tested set data structure library for Go, offering both thread-safe and non-thread-safe set implementations modeled after Python's set collection. It supports set operations like union, intersection, and difference, plus JSON/BSON marshaling and Go 1.23+ iterators.

## Use cases
- need a set data structure in Go
- deduplicate items in a Go collection
- perform set operations like union and intersection in Go
- thread-safe set for concurrent Go code
- replace Python-style sets when porting to Go

## When to choose
- you need a mature, widely-adopted set implementation in Go
- you need thread-safe sets for concurrent access
- you want generics support on Go 1.18+

## When to avoid
- you only need simple deduplication and prefer a plain map[T]struct{}
- you're on Go versions older than 1.18

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, developer-tools
- domain: developer-tools
- platform: go, cross-platform
- tags: set, data-structures, generics, threadsafe, golang, algorithms

## Member repositories
- deckarep/golang-set (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:57.176397+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:13.047804+00:00, confidence not recorded.
  - readme: https://github.com/deckarep/golang-set (fetched 2026-08-28T04:08:57.176397+00:00, sha ff934714582c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
