Helpfully Functional Go like underscore.js

Overview
                  /\ \                                                       
 __  __    ___    \_\ \     __   _ __   ____    ___    ___   _ __    __	         __     ___
/\ \/\ \ /' _ `\  /'_  \  /'__`\/\  __\/ ,__\  / ___\ / __`\/\  __\/'__`\      /'_ `\  / __`\
\ \ \_\ \/\ \/\ \/\ \ \ \/\  __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\  __/  __ /\ \L\ \/\ \L\ \
 \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\\ \____ \ \____/
  \/___/  \/_/\/_/\/__,_ /\/____/ \/_/ \/___/  \/____/\/___/  \/_/ \/____/\/_/ \/___L\ \/___/
                                                                                 /\____/
                                                                                 \_/__/

Underscore.go GoDoc Go Report Card Version

like underscore.js and C# LINQ, but for Go

Installation

$ go get github.com/ahl5esoft/golang-underscore

Update

$ go get -u github.com/ahl5esoft/golang-underscore

Lack

  • Concat/ThenBy

Documentation

API

Aggregate(memo, fn) IEnumerable

Arguments

  • iterator - func(element or value, key or index, memo) memo
  • memo - anyType

Examples

var res []int
Chain([]int{1, 2}).Aggregate(
	func(memo []int, n, _ int) []int {
		memo = append(memo, n)
		memo = append(memo, n+10)
		return memo
	},
	make([]int, 0),
).Value(&res)
// res = [1 11 2 12]

Same

  • Reduce

All(predicate) bool

Arguments

  • predicate - func(element, index or key) bool

Return

  • bool - all the values that pass a truth test predicate

Examples

ok := Chain([]testModel{
	{ID: 1, Name: "one"},
	{ID: 1, Name: "two"},
	{ID: 1, Name: "three"},
}).All(func(r testModel, _ int) bool {
	return r.ID == 1
})
// ok == true

AllBy(fields) bool

Arguments

  • fields - map[string]interface{}

Return

  • bool - all the values that pass a truth test predicate

Examples

ok := Chain([]testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "one"},
	{ID: 3, Name: "one"},
}).AllBy(map[string]interface{}{
	"name": "one",
})
// ok == true

Any(predicate) bool

Arguments

  • predicate - func(element or value, index or key) bool

Return

  • bool - any of the values that pass a truth test predicate

Examples

ok := Chain([]testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}).Any(func(r testModel, _ int) bool {
	return r.ID == 0
})
// ok == false

AnyBy(fields) bool

Arguments

  • fields - map[string]interface{}

Return

  • bool

Examples

ok := Chain([]testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}).AnyBy(map[string]interface{}{
	"name": "two",
})
// ok == true

Chain(source) IEnumerable

Arguments

  • source - array or map

Examples

var dst int
Range(1, benchmarkSize, 1).Select(func(r, _ int) int {
	return -r
}).Where(func(r, _ int) bool {
	return r < -20
}).First().Value(&dst)
// dst = -21

Count() int

Examples

src := []string{"a", "b", "c"}
dst := Chain(src).Count()
// dst = 3

Same

  • Size

Distinct(selector) IEnumerable

Arguments

  • selector - nil or func(element or value, index or key) anyType

Examples

src := []int{1, 2, 1, 4, 1, 3}
dst := make([]int, 0)
Chain(src).Distinct(func(n, _ int) (int, error) {
	return n % 2, nil
}).Value(&dst)
// dst = [1 2]

Same

  • Uniq

DistinctBy(fieldName) IEnumerable

Arguments

  • fieldName - string

Examples

src := []testModel{
	{ID: 1, Name: "a"},
	{ID: 2, Name: "a"},
	{ID: 3, Name: "a"},
}
dst := make([]testModel, 0)
Chain(src).DistinctBy("name").Value(&dst)
// dst = [{1 a}]

Same

  • UniqBy

Each(iterator)

Arguments

  • iterator - func(element or value, index or key)

Examples

arr := []testModel{
	{ID: 1, Name: "one"},
	{ID: 1, Name: "two"},
	{ID: 1, Name: "three"},
}
Chain(arr).Each(func(r testModel, i int) {
	if !(r.ID == arr[i].ID && r.Name == arr[i].Name) {
		// wrong
	}
})

Field(name)

Arguments

  • name - field name

Return

  • func(interface{}) interface{}

Examples

item := testModel{ 1, "one" }

getAge := Field("age")
_, err := getAge(item)
// err != nil

getName := Field("name")
name, err := getName(item)
// name = "one"

FieldValue(name)

Arguments

  • name - field name

Return

  • func(interface{}) reflect.Value

Examples

item := testModel{ 1, "one" }

getAgeValue := FieldValue("age")
res := getAgeValue(item)
// res != reflect.Value(nil)

getNameValue := FieldValue("name")
nameValue, err := getNameValue(item)
// nameValue = reflect.ValueOf("one")

Find(predicate) IEnumerable

Arguments

  • predicate - func(element or value, index or key) bool

Examples

var dst int
Chain([]int{1, 2, 3}).Find(func(r, _ int) bool {
	return r == 2
}).Value(&dst)
// dst == 2
// or
var dst int
Chain([][]int{
	[]int{1, 3, 5, 7},
	[]int{2, 4, 6, 8},
}).Find(func(r []int, _ int) bool {
	return r[0]%2 == 0
}).Find(func(r, _ int) bool {
	return r > 6
}).Value(&dst)
// dst == 8

FindBy(fields) IEnumerable

Arguments

  • fields - map[string]interface{}

Examples

src := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}
var dst testModel
Chain(src).FindBy(map[string]interface{}{
	"id": 2,
}).Value(&dst)
// dst == src[1]

FindIndex(predicate) int

Arguments

  • predicate - func(element or value, index or key) bool

Return

  • int - index

Examples

src := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}
index := Chain(src).FindIndex(func(r testModel, _ int) bool {
	return r.Name == src[1].Name
})
// i == 1

FindIndexBy(fields) int

Arguments

  • fields - map[string]interface{}

Return

  • int - index

Examples

src := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}
index := Chain(src).FindIndexBy(map[string]interface{}{
	"id": 1,
})
// index == 0

First() IEnumerable

Arguments

  • predicate - func(element or value, index or key) bool

Examples

var dst int
Chain([]int{1, 2, 3}).First().Value(&dst)
// dst == 1
// or
var dst int
Chain([][]int{
	[]int{1, 3, 5, 7},
	[]int{2, 4, 6, 8},
}).First().First().Value(&dst)
// dst == 1

Group(keySelector) IEnumerable

Arguments

  • keySelector - func(element or value, index or key) anyType

Examples

dst := make(map[string][]int)
Chain([]int{1, 2, 3, 4, 5}).Group(func(n, _ int) string {
	if n%2 == 0 {
		return "even"
	}
	return "odd"
}).Value(&dst)
// dst = map[odd:[1 3 5] even:[2 4]]

GroupBy(fieldName) IEnumerable

Arguments

  • fieldName - field name

Examples

dst := make(map[string][]testModel)
Chain([]testModel{
	{ID: 1, Name: "a"},
	{ID: 2, Name: "a"},
	{ID: 3, Name: "b"},
	{ID: 4, Name: "b"},
}).GroupBy("Name").Value(&dst)
// dst = map[a:[{1 a} {2 a}] b:[{3 b} {4 b}]]

Index(indexSelector) IEnumerable

Arguments

  • indexSelector - func(element or value, index or key) anyType

Examples

src := []string{ "a", "b" }
var res map[string]string
Chain(src).Index(func (r string, _ int) string {
	return r
}).Value(&res)
// or
res := Index(src, func (r string, _ int) string {
	return r
}).(map[string]string)
// res = map[a:a b:b]

IndexBy(property) IEnumerable

Arguments

  • property - string

Examples

arr := []testModel{
	{ID: 1, Name: "a"},
	{ID: 2, Name: "a"},
	{ID: 3, Name: "b"},
	{ID: 4, Name: "b"},
}
var res map[int]testModel
Chain(arr).IndexBy("id").Value(&res)
// or
res := IndexBy(arr, "id").(map[int]testModel)
// res = map[1:{{0} 1 a} 2:{{0} 2 a} 3:{{0} 3 b} 4:{{0} 4 b}]

IsArray(element) bool

Arguments

  • element - object

Examples

if !IsArray([]int{}) {
	// wrong
}

if IsArray(map[string]int{}) {
	// wrong
}

IsMatch(element, fields) bool

Arguments

  • element - object
  • fields - map[string]interface{}

Examples

m := testModel{ 1, "one" }
ok := IsMatch(nil, nil)
// ok = false

ok = IsMatch(m, nil)
// ok = false

ok = IsMatch(m, map[string]interface{}{
	"id": m.Id,
	"name": "a",
})
// ok = false

ok = IsMatch(m, map[string]interface{}{
	"id": m.Id,
	"name": m.Name,
})
// ok = true

Keys() IEnumerable

Examples

src := []string{"aa", "bb", "cc"}
dst := make([]int, 0)
Chain(src).Keys().Value(&dst)
// dst = [0 1 2]

src := map[int]string{
	1: "a",
	2: "b",
	3: "c",
	4: "d",
}
dst := make([]int, 0)
Chain(src).Keys().Value(&dst)
// dst = [1 2 3 4]

Last() IEnumerable

Examples

arr := []int{1, 2, 3}
var res int
chain(arr).Last().Value(&res)
// res = 3

var res []int
src := [][]int{
	{1, 2, 3, 4},
	{5, 6},
}
Chain(src).Last().Map(func(r, _ int) int {
	return r + 5
}).Value(&res)
// res = [10, 11]

Object() IEnumerable

Examples

src := [][]interface{}{
	[]interface{}{"a", 1},
	[]interface{}{"b", 2},
}
dst := make(map[string]int)
Chain(src).Object().Value(&dst)
// dst = map[a:1 b:2]

Order(selector) IEnumerable

Arguments

  • selector - func(element, key or index) anyType

Examples

arr := []testModel{
	{ID: 2, Name: "two"},
	{ID: 1, Name: "one"},
	{ID: 3, Name: "three"},
}
var res []testModel
Chain(arr).Order(func(n testModel, _ int) int {
	return n.ID
}).Value(&res)
// res = [{{0} 1 one} {{0} 2 two} {{0} 3 three}]

Same

  • Sort

OrderBy(fieldName) IEnumerable

Arguments

  • fieldName - string

Examples

arr := []testModel{
	{ID: 2, Name: "two"},
	{ID: 1, Name: "one"},
	{ID: 3, Name: "three"},
}
var res []testModel
Chain(arr).OrderBy("id").Value(&res)
// res = [{{0} 1 one} {{0} 2 two} {{0} 3 three}]

Same

  • SortBy

Range(start, stop, step) IEnumerable

Arguments

  • start - int
  • stop - int
  • step - int

Examples

var res []int
Range2(0, 0, 1).Value(&res)
// res = []

var res []int
Range2(0, 10, 0).Value(&res)
// panic

var res []int
Range2(4, 0, -1).Value(&res)
// res = [4 3 2 1]

var res []int
Range2(0, 2, 1).Value(&res)
// res = [0 1]

var res []int
Range2(0, 3, 2).Value(&res)
// res = [0 2]

Reject(predicate) IEnumerable

Arguments

  • predicate - func(element or value, index or key) bool

Examples

arr := []int{1, 2, 3, 4}
var res []int
Chain(arr).Reject(func(n, i int) bool {
	return n%2 == 0
}).Value(&res)
// res = [1, 3]

Same

  • Except

RejectBy(fields) IEnumerable

Arguments

  • fields - map[string]interface{}

Examples

arr := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}
var res []testModel
Chain(arr).RejectBy(map[string]interface{}{
	"Id": 1,
}).Value(&res)
// res = []testModel{ {ID: 2, Name: "two"}, {ID: 3, Name: "three"} }

Same

  • ExceptBy

Reverse(selector) IEnumerable

Arguments

  • selector - func(element, index or key) anyType

Examples

src := []testModel{
	{ID: 2, Name: "two"},
	{ID: 1, Name: "one"},
	{ID: 3, Name: "three"},
}
var res []testModel
Chain(src).Reverse(func(r testModel, _ int) int {
	return r.ID
}).Value(&res)
// res = []testModel{ {ID: 3, Name: "three"}, {ID: 2, Name: "two"}, {ID: 1, Name: "one"} }

ReverseBy(fieldName) IEnumerable

Arguments

  • fieldName - string

Examples

src := []testModel{
	{ID: 2, Name: "two"},
	{ID: 1, Name: "one"},
	{ID: 3, Name: "three"},
}
var res []testModel
Chain(src).ReverseBy("id").Value(&res)
// res = []testModel{ {ID: 3, Name: "three"}, {ID: 2, Name: "two"}, {ID: 1, Name: "one"} }

Select(selector) IEnumerable

Arguments

  • selector - func(element, index or key) anyType

Examples

src := []string{"11", "12", "13"}
dst := make([]int, 0)
Chain(src).Select(func(s string, _ int) int {
	n, _ := strconv.Atoi(s)
	return n
}).Value(&dst)
// dst = [11 12 13]

Same

  • Map

SelectBy(fieldName) IEnumerable

Arguments

  • fieldName - string

Examples

src := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "two"},
	{ID: 3, Name: "three"},
}
dst := make([]string, 0)
Chain(src).SelectBy("name").Value(&dst)
// dst = [one two three]

Same

  • MapBy

SelectMany(selector) IEnumerable

Arguments

  • selector - func(element, index or key) anyType with array or slice

Examples

src := [2]int{1, 2}
var dst []int
Chain(src).SelectMany(func(r, _ int) []int {
	return []int{r - 1, r + 1}
}).Value(&dst)
// dst = [0 2 1 3]

Same

  • MapMany

SelectManyBy(property) IEnumerable

Arguments

  • property - string

Examples

src := []testSelectManyModel{
	{Array: [2]int{1, 2}},
	{Array: [2]int{3, 4}},
}
var dst []int
Chain(src).SelectManyBy("Array").Value(&dst)
// res = [1 2 3 4]

Same

  • MapManyBy

Skip(count) IEnumerable

Arguments

  • count - int

Examples

src := []int{1, 2, 3}
dst := make([]int, 0)
Chain(src).Skip(2).Value(&dst)
// dst = [3]

Take(count) IEnumerable

Arguments

  • count - int

Examples

src := []int{1, 2, 3}
dst := make([]int, 0)
Chain(src).Take(1).Value(&dst)
// res = [1]

Values() IEnumerable

Examples

src := []string{"a", "b"}
dst := make([]string, 0)
Chain(src).Values().Value(&dst)
// dst = [a b]

src := map[int]string{
	1: "a",
	2: "b",
	3: "c",
	4: "d",
}
dst := make([]string, 0)
Chain(src).Values().Value(&dst)
// dst = [a b c d]

Where(predicate) IEnumerable

Arguments

  • predicate - func(element or value, index or key) bool

Examples

src := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "one"},
	{ID: 3, Name: "three"},
	{ID: 4, Name: "three"},
}
dst := make([]testModel, 0)
Chain(src).Where(func(r testModel, _ int) bool {
	return r.ID%2 == 0
}).Value(&dst)
// len(dst) == 2 && dst[0] == src[1] && dst[1] == src[3])

Same

  • Filter

WhereBy(fields) IEnumerable

Arguments

  • fields - map[string]interface{}

Examples

src := []testModel{
	{ID: 1, Name: "one"},
	{ID: 2, Name: "one"},
	{ID: 3, Name: "three"},
	{ID: 4, Name: "three"},
}
dst := make([]testModel, 0)
Chain(src).WhereBy(map[string]interface{}{
	"Name": "one",
}).Value(&dst)
// len(dst) == 2 && dst[0] == src[0] && dst[1] == src[1]

Same

  • FilterBy

Release Notes

v2.1.0 (2020-11-17)
* IEnumerable增加Order、OrderBy、Sort、SortBy
* IEnumerable.Aggregate(memo interface{}, fn interface{}) -> IEnumerable.Aggregate(fn interface{}, memo interface{})
v2.0.0 (2019-06-27)
* 删除IQuery
* IEnumerable增加MapMany、MapManyBy、SelectMany、SelectManyBy
v1.6.0 (2019-06-21)
* IEnumerable增加Count、Size
* 删除FindLastIndex
v1.5.0 (2019-06-18)
* 增加Chain Benchmark
* IEnumerable增加Group、GroupBy
* 优化IEnumerable的Distinct、Enumerator、Index、Property、Select、Where
v1.4.0 (2019-06-15)
* Reduce、Take支持IEnumerable
* IEnumerable增加Aggregate、Skip
* IQuery删除Clone
* 优化IEnumerable的First、Index、Values
v1.3.0 (2019-06-09)
* FindIndex、FindIndexBy、Keys、Map、MapBy、Object、Uniq、UniqBy、Values支持IEnumerable
* IEnumerable增加Distinct、DistinctBy、Select、SelectBy
v1.2.0 (2019-06-04)
* Each、Filter、Where支持IEnumerable
v1.1.0 (2019-06-02)
* 增加IEnumerable、IEnumerator
* All、Any、Chain、Find、First、Range2、Value支持IEnumerable
v1.0.0 (2019-04-23)
* first edition
Issues
  • Reduce interface declaration

    Reduce interface declaration

    Maybe I'm wrong but for be more explainatoried the IEnumerable interface declares Reduce as Reduce(memo interface{}, fn interface{}) IEnumerable may be should be Reduce(fn interface{}, memo interface{}) IEnumerable?

    opened by ea3hsp 2
  • Pluck field from nested struct?

    Pluck field from nested struct?

    When there is a nested struct in the targeted struct reflection exception is thrown:

    type Tag struct {
        ModelBase
        Title string
        Slug string
    }
    
    type ModelBase struct {
        ID uint
    }
    
    v := underscore.Pluck(tags, `ID`)
    
    => 
    
    reflect: call of reflect.Value.Type on zero Value
    

    Any advice appreciated, thanks

    opened by arthurlataks 2
  • License for project

    License for project

    Hey There,

    Our team would like to use your stuff, however, our company won't allow us to use any open source software without a license. Would you mind adding one, we would really appreciate it!

    Thanks, Mike

    opened by rsdmike 2
  • Incompatible version v2.2.0

    Incompatible version v2.2.0

    While using the package I am using the issue

    go: finding a module for package github.com/ahl5esoft/golang-underscore
    go: found github.com/ahl5esoft/golang-underscore in github.com/ahl5esoft/golang-underscore v2.0.0+incompatible
    

    If I explicitly use v2.2.0 in go mod again it fails.

    go: github.com/ahl5esoft/[email protected]+incompatible/go.mod: verifying module: github.com/ahl5esoft/[email protected]+incompatible/go.mod: reading https://sum.golang.org/lookup/github.com/ahl5esoft/[email protected]+incompatible: 410 Gone
            server response: not found: github.com/ahl5esoft/[email protected]+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required
    
    

    I am using go version 1.15 same as in your go mod, though .github/workflows/go.yml shows version go v1.13. Is this the reason of incompatibility?

    require github.com/ahl5esoft/golang-underscore: version "v2.2.0" invalid: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
    
    opened by sankalpbohra 1
  • FindBy - How check if result exist?

    FindBy - How check if result exist?

    In this Example, how check if have result with id 4?

    src := []testModel{
    	{ID: 1, Name: "one"},
    	{ID: 2, Name: "two"},
    	{ID: 3, Name: "three"},
    }
    var dst testModel
    Chain(src).FindBy(map[string]interface{}{
    	"id": 4,
    }).Value(&dst)
    
    ????????????
    if dst != nil {
       //here result
    } else {
      //don't have nothing
    }
    
    opened by darlandieterich 1
  • There is no pluck method in the new version.

    There is no pluck method in the new version.

    There is no pluck method in the new version. Also, it's not compatible with the older version. It breaks everything after updating to the current version

    opened by rakib32 1
  • Map arguments

    Map arguments

    We have https://github.com/ahl5esoft/golang-underscore#map in Readme there Map can be called with 3 arguments, by as I see in the implementation, now it's waiting for just 2 arguments.

    opened by kalashnikovisme 1
  • Add method to get the last index of an array or a slice and unit testing

    Add method to get the last index of an array or a slice and unit testing

    Hey, I've seen on the readme file of your project that the feature allowing to get the last index was missing so I thought I would contribute by adding it. Let me know what you think, oh and awesome by the way.

    Regards.

    opened by ABYamani 1
  • Add .gitignore

    Add .gitignore

    Added a .gitignore file that ignores:

    • .DS_Store file (a file generated by macOS)
    • .idea (project directory generated by GoLand)
    • .vscode (project directory generated by Visual Studio Code)
    opened by algobot76 0
  • Use consistent file formats and standards

    Use consistent file formats and standards

    I noticed that files were not being loaded consistently.

    This PR updates file format and rename's the filenames, replacing dash with underscore.

    I noticed this and came up with PR.

    opened by ikennaokpala 0
Releases(v2.6.1)
Code Generation for Functional Programming, Concurrency and Generics in Golang

goderive goderive derives mundane golang functions that you do not want to maintain and keeps them up to date. It does this by parsing your go code fo

Walter Schulze 998 Aug 5, 2022
Make Go functional with dogs

dogs Make Go functional with dogs Caution This is a highly-experimental package. Any changes will be made in a backward-incompatible manner. This pack

Genta Kamitani 36 May 24, 2022
Functional tools in Go 1.18 using newly introduced generics

functools functools is a simple Go library that brings you your favourite functi

Rakeeb Hossain 176 Aug 3, 2022
Utilities and immutable collections for functional programming in Golang

Utilities and immutable collections for functional programming in Golang. This is an experimental library to play with the new Generics Feature in Go 1.18.

Peter Zeller 8 May 20, 2022
A collection of functional operators for golang with generics

fn fn is a collection of go functional operators with generics Getting Started P

Billy Irwin 9 Jul 8, 2022
F - Experimenting with Go 1.18 generics to write more functional Go code

f f is a simple library that leverages the new generics in Golang to create a tools for functional style of code. Pipe like '|>' in Elixir or Elm. inp

Amirreza Askarpour 3 Apr 12, 2022
Golang source code parsing, usage like reflect package

gotype Golang source code parsing, usage like reflect package English 简体中文 Usage API Documentation Examples License Pouch is licensed under the MIT Li

null 44 Jul 14, 2022
A super simple Lodash like utility library with essential functions that empowers the development in Go

A simple Utility library for Go Go does not provide many essential built in functions when it comes to the data structure such as slice and map. This

Rahul Baruri 127 Jul 9, 2022
Creates Prometheus Metrics for PolicyReports and ClusterPolicyReports. It also sends PolicyReportResults to different Targets like Grafana Loki or Slack

PolicyReporter Motivation Kyverno ships with two types of validation. You can either enforce a rule or audit it. If you don't want to block developers

Frank Jogeleit 0 Aug 6, 2021
Go Stream, like Java 8 Stream.

Go Stream, like Java 8 Stream.

Youth.霖 63 Jul 30, 2022
🔍 A jq-like tool that queries files via glob.

?? fq A jq-like tool that queries files via glob. ✅ Prerequisites Go 1.17+ jq (installed and on PATH) ?? Installation $ go get github.com/siketyan/fq

Naoki Ikeguchi 5 Dec 22, 2021
A fully Go userland with Linux bootloaders! u-root can create a one-binary root file system (initramfs) containing a busybox-like set of tools written in Go.

u-root Description u-root embodies four different projects. Go versions of many standard Linux tools, such as ls, cp, or shutdown. See cmds/core for m

null 2k Aug 11, 2022
generate random data like name, email, uuid, address, images and etc.

gg-rand generate random data like name, email, uuid, address, images and etc. build and install: make run: gg-rand $ gg-rand SillyName : Knavesa

bingoohuang 2 Mar 13, 2022
Like tools/cmd/stringer with bitmask features

Bitmasker Bitmasker is a tool used to automate the creation of helper methods when dealing with bitmask-type constant flags. Given the name of an unsi

Go Curses 0 Nov 25, 2021
CDN-like in-memory cache with shielding, and Go 1.18 Generics

cache CDN-like, middleware memory cache for Go applications with integrated shielding and Go 1.18 Generics. Usage package main import ( "context" "

Alex 0 Apr 26, 2022
A go1.18+ package to (maybe) simplify performing operations on slices in a fluent-like style.

sop ✨ W.I.P. ✨ sop (slices operation) is a go1.18+ package to (maybe) simplify performing operations on slices in a fluent-like style with common oper

Ringo Hoffmann 3 Mar 17, 2022
An application written in Go to generate fractals like the Mandelbrot set and the Julia set.

Fractals An application written in Go to generate fractals like the Mandelbrot set and the Julia set. Screenshots Mandelbrot set Julia set Prerequisit

null 0 May 9, 2022
Quicat -- a socat-like utility for working with QUIC

Quicat -- a socat-like utility for working with QUIC This is a utility that I occasionally use for building secure-enough tunnels on flaky connections

Pavel Khlebovich 0 Feb 6, 2022
Experimenting with golang generics to implement functional favorites like filter, map, && reduce.

funcy Experimenting with golang generics to implement functional favorites like filter, map, && reduce. 2021-12 To run the tests, you need to install

null 0 Dec 29, 2021
Code Generation for Functional Programming, Concurrency and Generics in Golang

goderive goderive derives mundane golang functions that you do not want to maintain and keeps them up to date. It does this by parsing your go code fo

Walter Schulze 998 Aug 5, 2022
Several functional programming supporting in golang

A golang library that makes operations on slice easilier What can I do? slice process Map Filter Sort Reverse map process Keys Values output (starting

guanming 28 Jun 27, 2022
End to end functional test and automation framework

Declarative end to end functional testing (endly) This library is compatible with Go 1.12+ Please refer to CHANGELOG.md if you encounter breaking chan

Viant, Inc 214 Jul 23, 2022
Functional programming library for Go including a lazy list implementation and some of the most usual functions.

functional A functional programming library including a lazy list implementation and some of the most usual functions. import FP "github.com/tcard/fun

Toni Cárdenas 31 May 21, 2022
An always-on framework that performs end-to-end functional network testing for reachability, latency, and packet loss

Arachne Arachne is a packet loss detection system and an underperforming path detection system. It provides fast and easy active end-to-end functional

Uber Open Source 367 Jul 30, 2022
vcluster - Create fully functional virtual Kubernetes clusters - Each cluster runs inside a Kubernetes namespace and can be started within seconds

Website • Quickstart • Documentation • Blog • Twitter • Slack vcluster - Virtual Clusters For Kubernetes Lightweight & Low-Overhead - Based on k3s, bu

Loft Labs 1.8k Aug 7, 2022
The package manager for macOS you didn’t know you missed. Simple, functional, and fast.

Stew The package manager for macOS you didn’t know you missed. Built with simplicity, functionality, and most importantly, speed in mind. Installation

Stew 20 Mar 30, 2022
functional programming in go

function programming experimental lib why another fp lib I like fp style and I haven’t found a lib with these features: streamingly, I can handle infi

Jason 8 May 19, 2022
functional.go

functional.go Adding functional programming capabilities to golang with new generics Any x := []int{1, 2, 3, 4} fmt.Println(f.Any(func(y int) bool {

Will 10 Nov 8, 2021
Make Go functional with dogs

dogs Make Go functional with dogs Caution This is a highly-experimental package. Any changes will be made in a backward-incompatible manner. This pack

Genta Kamitani 36 May 24, 2022