Categorygithub.com/1eedaegon/go-hashset
modulepackage
0.0.2
Repository: https://github.com/1eedaegon/go-hashset.git
Documentation: pkg.go.dev

# README

go-hashset

Go CI CodeQL

A go library hashset for O(1)

Example

Initialize set and Add element

import (
	...
	hashset "github.com/1eedaegon/go-hashset"
	...
)

	s := hashset.New(1, 2, "3")
	s.Add("3") // Since "3" already exists in the Set, its size remains 3.

Remove and Distinguish between different types

import (
	...
	hashset "github.com/1eedaegon/go-hashset"
	...
)
    s := hashset.New("1", "2", 3)
	s.Remove("1")
	s.Remove("multiple")
	s.Remove("3") // The length of s is 2, because due to the difference in types.

Other case doc: https://pkg.go.dev/github.com/1eedaegon/go-hashset

License

MIT

# Functions

Powerful assertion comparable type by generic on compile time.
MakeComparable returns pointer(address) not comparable types: slice, map, function.
New initializes and returns a new Set with optional initial elements.

# Structs

No description provided by the author