()
| 28 | } |
| 29 | |
| 30 | func (g *graph) EdgesIter() <-chan Edge { |
| 31 | ch := make(chan Edge) |
| 32 | go func() { |
| 33 | for from, connectedVertices := range g.edges { |
| 34 | for to, _ := range connectedVertices { |
| 35 | if g.isDirected { |
| 36 | ch <- Edge{from, to} |
| 37 | } else { |
| 38 | if from < to { |
| 39 | ch <- Edge{from, to} |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | close(ch) |
| 45 | }() |
| 46 | return ch |
| 47 | } |
| 48 | |
| 49 | func (g *graph) VerticesIter() <-chan VertexId { |
| 50 | ch := make(chan VertexId) |
nothing calls this directly
no outgoing calls
no test coverage detected