Skip to content

meteormin/gollection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gollection - go collection pkg

install

go get meteormin/gollection

usage

package main

import (
	"github.com/meteormin/gollection"
	"log"
)

func main() {
	items := []int{1, 2, 3}
	collect := gollection.NewCollection(items)

	collect.For(func(v int, i int) {
		log.Print(v)
	})
	// result: 1 2 3

	collect.Chunk(100, func(v []int, i int) {
		log.Print(v) // chunked slice..
	})
}