Skip to content
/ cols Public

Colllections function that use go1.18 generic

License

Notifications You must be signed in to change notification settings

egon12/cols

Repository files navigation

cols

Colllections function that use go1.18 generic

Examples:

import (
	"fmt"

	"github.com/egon12/cols"
)

func ExampleMap() {
	in := []Obj{
		{Name: "Peter", BirthDate: 31},
		{Name: "Simon", BirthDate: 29},
		{Name: "Kikorosuma", BirthDate: 10},
	}

	got := cols.Map(in, func(o Obj) string {
		return o.Name
	})

	fmt.Println(got)
	// Output: [Peter Simon Kikorosuma]
}

For complete documentation you can go to pkg.go.dev/github.com/egon12/cols

About

Colllections function that use go1.18 generic

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages