Skip to content
Node: Setgithub.com/sahilkhaire/gox/set

Set

Overview

Set is a set of comparable values.

Part of the set package — Node.js analog: Set.

Set is a type exported by gox. Methods on this type are documented separately.

Signature

go
type Set[T comparable] map[T]struct{}

Compare: Node.js · Standard Go · gox

js
// Typical Set pattern in Node.js
go
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.
go
import "github.com/sahilkhaire/gox/set"

s := set.New("go", "node", "rust")
_ = s.Has("go")

Example

go
import "github.com/sahilkhaire/gox/set"

s := set.New("go", "node", "rust")
_ = s.Has("go")

Tips

Browse methods on this type in the sidebar for handler-style APIs and options structs.

Standard library alternative

gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.

Back to set package overview

MIT Licensed · Built for Node.js developers moving to Go