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

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -