Function
closeAfterN
(n int, source chan watch.Event)
Source from the content-addressed store, hash-verified
| 122 | } |
| 123 | |
| 124 | func closeAfterN(n int, source chan watch.Event) chan watch.Event { |
| 125 | result := make(chan watch.Event, 0) |
| 126 | go func() { |
| 127 | defer close(result) |
| 128 | defer close(source) |
| 129 | for i := 0; i < n; i++ { |
| 130 | result <- <-source |
| 131 | } |
| 132 | }() |
| 133 | return result |
| 134 | } |
| 135 | |
| 136 | type unexpectedError struct { |
| 137 | // Inheriting any struct fulfilling runtime.Object interface would do. |
Tested by
no test coverage detected