Channels returns all the unique channels used by the format.
()
| 136 | |
| 137 | // Channels returns all the unique channels used by the format. |
| 138 | func (f *Format) Channels() Channels { |
| 139 | seen := map[Channel]struct{}{} |
| 140 | out := make(Channels, 0, len(f.Components)) |
| 141 | for _, t := range f.Components { |
| 142 | if _, ok := seen[t.Channel]; !ok { |
| 143 | out = append(out, t.Channel) |
| 144 | seen[t.Channel] = struct{}{} |
| 145 | } |
| 146 | } |
| 147 | return out |
| 148 | } |
| 149 | |
| 150 | // GetSingleComponent returns the single component that matches the predicate p. |
| 151 | func (f *Format) GetSingleComponent(p func(*Component) bool) *Component { |
no outgoing calls
no test coverage detected