Skip to main content Link Search Menu Expand Document (external link)

Take

func (input *Channel[T]) Take(n uint64)

Take sends the first n input values to the output channel, and then stops processing input and closes the output channel.

Example

output := input.Take(3)