In Go, how can I partition a slice/array/string of any type? -


guava has generic partition method can not directly implemented in go due go's lack of generics. there workaround this?

the gopart library addresses this. allows partitioning of indexable in go has type.

for idxrange := range gopart.partition(len(biglist), partitionsize) {         bulkoperation(biglist[idxrange.low:idxrange.high]) } 

full executable example


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -