mirror of
https://github.com/samber/lo.git
synced 2026-04-22 15:37:14 +08:00
feat(generator): deprecate lo.Generator in favor of go "iter" package (#700)
This commit is contained in:
@@ -191,6 +191,8 @@ func ChannelToSlice[T any](ch <-chan T) []T {
|
||||
|
||||
// Generator implements the generator design pattern.
|
||||
// Play: https://go.dev/play/p/lIbSY3QmiEg
|
||||
//
|
||||
// Deprecated: use "iter" package instead (Go >= 1.23)
|
||||
func Generator[T any](bufferSize int, generator func(yield func(T))) <-chan T {
|
||||
ch := make(chan T, bufferSize)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user