Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.22 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.22 KB

hashset

Go Version Go Reference Build Status License

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
}

Installation

go get github.com/shalldie/gog/hashset

Description

HashSet is a collection that contains no duplicate elements, the usage can refer to HashMap.

HashSet 是一个不允许有重复元素的集合,使用方式可参考 HashMap

License

MIT