(ctx context.Context, c <-chan T)
| 36 | } |
| 37 | |
| 38 | func ReceiveFromChannel[T any](ctx context.Context, c <-chan T) (T, bool) { |
| 39 | select { |
| 40 | case e := <-c: |
| 41 | return e, true |
| 42 | case <-ctx.Done(): |
| 43 | return zeroValue[T](), false |
| 44 | } |
| 45 | } |
no outgoing calls