SetOf creates a new Set. Returns an error if any names are invalid.
(chans ...ID)
| 82 | |
| 83 | // SetOf creates a new Set. Returns an error if any names are invalid. |
| 84 | func SetOf(chans ...ID) (Set, error) { |
| 85 | result := make(Set, len(chans)) |
| 86 | for _, ch := range chans { |
| 87 | if !IsValidChannel(ch.Name) { |
| 88 | return nil, illegalChannelError(ch.Name) |
| 89 | } |
| 90 | result[ch] = present{} |
| 91 | } |
| 92 | return result, nil |
| 93 | } |
| 94 | |
| 95 | // If the set contains "*", returns a set of only "*". Else returns the original set. |
| 96 | func ExpandingStar(set base.Set) base.Set { |
no test coverage detected