16 lines
244 B
Go
16 lines
244 B
Go
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
|
|
}
|