(ctx context.Context)
| 122 | } |
| 123 | |
| 124 | func getChannel(ctx context.Context) chan Item { |
| 125 | ch := make(chan Item, 3) |
| 126 | go func() { |
| 127 | time.Sleep(randomTime()) |
| 128 | Of(1).SendContext(ctx, ch) |
| 129 | time.Sleep(randomTime()) |
| 130 | Of(2).SendContext(ctx, ch) |
| 131 | time.Sleep(randomTime()) |
| 132 | Of(3).SendContext(ctx, ch) |
| 133 | }() |
| 134 | return ch |
| 135 | } |
| 136 | |
| 137 | func randomTime() time.Duration { |
| 138 | return time.Duration(rand.Intn(maxSleepNs)) * time.Nanosecond |
no test coverage detected
searching dependent graphs…