Skip to content

martinohmann/collections-go

Repository files navigation

collections-go

Build Status Go Report Card GoDoc

Mutable and immutable collections for commonly used builtin types. This package includes collection types generated by collections-gen for the following builtins:

In addition to that the following hand crafted collection types are included:

Installation

go get github.com/martinohmann/collections-go

Usage

c := collections.NewString([]string{"foo", "bar", "baz"})

items := c.
    Filter(func(item string) bool {
        return strings.HasPrefix(item, "ba")
    }).
    Reverse().
    Prepend("qux").
    Items()

fmt.Println(items)

// Output:
// [qux baz bar]

Check out the godocs for all available collection methods.

License

The source code of collections-go is released under the MIT License. See the bundled LICENSE file for details.

About

Golang collections for builtin types and generic slices

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages