add gem analyzer

This commit is contained in:
Alex Goodman
2020-06-04 14:42:59 -04:00
parent 033c91a233
commit f33720eaa1
18 changed files with 815 additions and 109 deletions
+28
View File
@@ -0,0 +1,28 @@
package internal
type Set map[string]struct{}
func NewStringSet() Set {
return make(Set)
}
func NewStringSetFromSlice(start []string) Set {
ret := make(Set)
for _, s := range start {
ret.Add(s)
}
return ret
}
func (s Set) Add(i string) {
s[i] = struct{}{}
}
func (s Set) Remove(i string) {
delete(s, i)
}
func (s Set) Contains(i string) bool {
_, ok := s[i]
return ok
}