Adds an item to the current set if it doesn't already exist in the set.
(i string)
| 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 { |
| 36 | _, found := set[i] |
| 37 | set[i] = struct{}{} |
| 38 | return !found //False if it e xisted already |
| 39 | } |
| 40 | |
| 41 | // Determines if a given item is already in the set. |
| 42 | func (set StringSet) Contains(i string) bool { |
no outgoing calls
no test coverage detected