Has looks for the existence of items passed. It returns false if nothing is passed. For multiple items it returns true only if all of the items exist.
(items ...string)
| 103 | // Has looks for the existence of items passed. It returns false if nothing is |
| 104 | // passed. For multiple items it returns true only if all of the items exist. |
| 105 | func (s Set) Has(items ...string) bool { |
| 106 | has := false |
| 107 | for _, item := range items { |
| 108 | if _, has = s[item]; !has { |
| 109 | break |
| 110 | } |
| 111 | } |
| 112 | return has |
| 113 | } |
| 114 | |
| 115 | // HasWithPrefix checks if at least one element of the set is the prefix of any of the passed items. |
| 116 | // It returns false if nothing is passed. |
no outgoing calls