Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mylxsw/coll
Coll is a collection library for Go
https://github.com/mylxsw/coll
collection filter golang map reduce
Last synced: about 1 month ago
JSON representation
Coll is a collection library for Go
- Host: GitHub
- URL: https://github.com/mylxsw/coll
- Owner: mylxsw
- License: mit
- Created: 2019-08-10T11:43:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T08:37:08.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T00:24:09.555Z (3 months ago)
- Topics: collection, filter, golang, map, reduce
- Language: Go
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Coll
[![Build Status](https://www.travis-ci.org/mylxsw/coll.svg?branch=master)](https://www.travis-ci.org/mylxsw/coll)
[![Coverage Status](https://coveralls.io/repos/github/mylxsw/coll/badge.svg?branch=master)](https://coveralls.io/github/mylxsw/coll?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/mylxsw/coll)](https://goreportcard.com/report/github.com/mylxsw/coll)
[![codecov](https://codecov.io/gh/mylxsw/coll/branch/master/graph/badge.svg)](https://codecov.io/gh/mylxsw/coll)
[![Sourcegraph](https://sourcegraph.com/github.com/mylxsw/coll/-/badge.svg)](https://sourcegraph.com/github.com/mylxsw/coll?badge)
[![GitHub](https://img.shields.io/github/license/mylxsw/coll.svg)](https://github.com/mylxsw/coll)Coll is a collection library for Go.
cc := coll.MustNew(testMapData)
collectionWithoutEmpty := cc.Filter(func(value string) bool {
return value != ""
}).Filter(func(value string, key string) bool {
return key != ""
})
collectionWithoutEmpty.Each(func(value, key string) {
if value == "" || key == "" {
t.Errorf("test failed: %s=>%s", key, value)
}
})