-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slices: add ChunkBy #53
base: master
Are you sure you want to change the base?
Conversation
This PR (HEAD: 462561b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/exp/+/459375 to see it. Tip: You can toggle comments from me using the |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
Message from Ian Lance Taylor: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
Message from Ian Lance Taylor: Patch Set 1: Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
Message from Ian Lance Taylor: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
Message from Ian Lance Taylor: Patch Set 1: Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
This PR (HEAD: 5fa5eb3) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/exp/+/459375. Important tips:
|
Message from Mauri de Souza Meneguzzo: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/459375. |
adds ChunkBy which accepts a slice and chunks the slice into segments of size <= given integer value
I find myself writing this function every time I start a new project as its necessary for batching api calls or distributing work to worker groups.
func ChunkBy[T any](s []T, n int) (chunks [][]T)