mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-29 23:22:45 +00:00
13 lines
167 B
Go
13 lines
167 B
Go
|
package util
|
||
|
|
||
|
type Set[E comparable] map[E]struct{}
|
||
|
|
||
|
func (s Set[E]) Add(v E) {
|
||
|
s[v] = struct{}{}
|
||
|
}
|
||
|
|
||
|
func (s Set[E]) Contains(v E) bool {
|
||
|
_, ok := s[v]
|
||
|
return ok
|
||
|
}
|