NewStringSet builds a string set.
(ss ...string)
| 25 | |
| 26 | // NewStringSet builds a string set. |
| 27 | func NewStringSet(ss ...string) StringSet { |
| 28 | set := make(StringSet, len(ss)) |
| 29 | for _, s := range ss { |
| 30 | set.Insert(s) |
| 31 | } |
| 32 | return set |
| 33 | } |
| 34 | |
| 35 | // Exist checks whether `val` exists in `s`. |
| 36 | func (s StringSet) Exist(val string) bool { |