Creates and returns a reference to a set from an existing slice
(s []string)
| 24 | |
| 25 | // Creates and returns a reference to a set from an existing slice |
| 26 | func NewStringSetFromSlice(s []string) StringSet { |
| 27 | a := NewStringSetWithCapacity(len(s)) |
| 28 | for _, item := range s { |
| 29 | a.Add(item) |
| 30 | } |
| 31 | return a |
| 32 | } |
| 33 | |
| 34 | // Adds an item to the current set if it doesn't already exist in the set. |
| 35 | func (set StringSet) Add(i string) bool { |
no test coverage detected