(vertex VertexId)
| 177 | } |
| 178 | |
| 179 | func (g *graph) GetNeighbours(vertex VertexId) VerticesIterable { |
| 180 | iterator := func() <-chan VertexId { |
| 181 | ch := make(chan VertexId) |
| 182 | go func() { |
| 183 | if connected, ok := g.edges[vertex]; ok { |
| 184 | for VertexId, _ := range connected { |
| 185 | ch <- VertexId |
| 186 | } |
| 187 | } |
| 188 | close(ch) |
| 189 | }() |
| 190 | return ch |
| 191 | } |
| 192 | |
| 193 | return VerticesIterable(&vertexIterableHelper{iterFunc: iterator}) |
| 194 | } |
| 195 | |
| 196 | type vertexIterableHelper struct { |
| 197 | iterFunc func() <-chan VertexId |
no test coverage detected