mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 06:56:40 +01:00
add gem analyzer
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user