Generic hashset of Golang. Golang 泛型 hashset 实现。
Need v1.18+
Example
{
hash := hashset.New[string, string]()
hash.Set("name", "tom")
hash.Set("name2", "tom")
fmt.Println(hash.Get("name")) // "tom"
fmt.Println(hash.Has("name")) // true
fmt.Println(hash.Has("name2")) // false
}
go get github.com/shalldie/gog/hashset
HashSet is a collection that contains no duplicate elements, the usage can refer to HashMap.
HashSet 是一个不允许有重复元素的集合,使用方式可参考 HashMap。
MIT