MCPcopy
hub / github.com/kubernetes/client-go / closeAfterN

Function closeAfterN

tools/watch/retrywatcher_test.go:124–134  ·  view source on GitHub ↗
(n int, source chan watch.Event)

Source from the content-addressed store, hash-verified

122}
123
124func 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
136type unexpectedError struct {
137 // Inheriting any struct fulfilling runtime.Object interface would do.

Callers 1

TestRetryWatcherFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected