channel/utils.go

16 lines
244 B
Go
Raw Normal View History

2025-01-15 12:31:59 +01:00
package channel
func determineBufferSize[T any](channels []<-chan T) int {
if len(channels) == 0 {
return 0
}
maxBufSize := 0
for _, ch := range channels {
if cap(ch) > maxBufSize {
maxBufSize = cap(ch)
}
}
return maxBufSize
}