⚙️ Golang functional utility library with syntactic sugar. It's like lodash, but for Go

Gubrak v2

Gubrak is Go functional utility library with syntactic sugar. It's like lodash, but for Go Programming language.

Go Report Card Build Status Coverage Status

Installation

The latest version of gubrak is v2. Here are the available method to get this library.

  • Using go get from github, for Go Mod-based project:

    go get -u github.com/novalagung/gubrak/v2
  • Using go get from github, for $GOPATH-based project:

    go get -u github.com/novalagung/gubrak

Usage

Since this library is developed as go module, the versioning system used is the one from Go.

  • For Go Mod-based project:

    import gubrak "github.com/novalagung/gubrak/v2"
  • For $GOPATH-based project:

    import "github.com/novalagung/gubrak"

Documentation

Hello World Example

Lodash for Golang

APIs

Below are the list of available functions on gubrak:

ChunkCompactConcatCountDifferenceDropDropRightEachEachRightFillFilterFindFindIndexFindLastFindLastIndexFirstForEachForEachRightFromPairsGroupByHeadIncludesIndexOfInitialIntersectionIsArrayIsBoolIsChannelIsDateIsEmptyIsEmptyStringIsFloatIsFunctionIsIntIsMapIsNilIsNumericIsPointerIsSliceIsStringIsStructObjectIsTrueIsUintIsZeroNumberJoinKeyByLastLastIndexOfMapNowNthOrderByPartitionPullPullAllPullAtRandomIntRandomStringReduceRejectRemoveReverseSampleSampleSizeShuffleSizeSortByTailTakeTakeRightUnionUniqWithout

Test

go test -cover -race -v ./... 

Contribution

Fork ➜ Create branch ➜ Commit ➜ Push ➜ Pull Requests

License

MIT License

Owner
Noval Agung Prayogo
Software Architect, Tech Lead, Open Source Enthusiast
Noval Agung Prayogo
Similar Resources

Goro: A High-level Machine Learning Library for Go

Goro: A High-level Machine Learning Library for Go

Overview Goro is a high-level machine learning library for Go built on Gorgonia. It aims to have the same feel as Keras. Usage import ( . "github.

Nov 20, 2022

Go-openoffice - Go library for reading OpenOffice odf and ods files

go-openoffice A Go library for reading OpenOffice/LibreOffice .ods (and .odf) fi

Dec 16, 2022

`go-redash-query` is a simple library to get structed data from `redash query` sources

go-redash-query go-redash-query is a simple library to get structed data from redash query sources Example Source table id name email 1 Dannyhann rhrn

May 22, 2022

A go wrapper around the rwkv.cpp library

AI without python (1) go-rwkv.cpp gowrkv.go is a wrapper around rwkv-cpp, which is an adaption of ggml.cpp. (1) Python required for training and conve

May 10, 2023

Golang 设计模式

Golang 设计模式

Golang设计模式思想 前言 一切设计模式都是灵活应用struct的组合模式,以及go隐形继承接口的特性 go中的interface就是一些方法装饰, 而struct并不依赖于接口 设计模式类型 创建模式 建造者模式(Builder Pattern) 将一个复杂对象的构建与它的表示分离, 使得同样

Dec 29, 2022

7 days golang programs from scratch (web framework Gee, distributed cache GeeCache, object relational mapping ORM framework GeeORM, rpc framework GeeRPC etc) 7天用Go动手写/从零实现系列

7 days golang programs from scratch README 中文版本 7天用Go从零实现系列 7天能写什么呢?类似 gin 的 web 框架?类似 groupcache 的分布式缓存?或者一个简单的 Python 解释器?希望这个仓库能给你答案

Jan 5, 2023

Examples of Golang compared to Node.js for learning

Examples of Golang compared to Node.js for learning

This guide full of examples is intended for people learning Go that are coming from Node.js, although the vice versa can work too. This is not meant to be a complete guide and it is assumed that you've gone through the Tour of Go tutorial. This guide is meant to be barely good enough to help you at a high level understand how to do X in Y and doing further learning on your own is of course required.

Jan 9, 2023

Golang && Back-end Stack , Continually updated

Stack Here Golang OS Net Note Tool Delve Authentication Paper Paper 📚 Link GO官方文档 GO Official Doc GO官方博客 GO Official Blog GO官方仓库

Nov 8, 2022

The Ultimate Workshop Track for #golang Developer

The Ultimate Workshop Track  for #golang Developer

layout title nav_order description permalink default An Ultimate GopherLabs Hands-on Labs 1 An Ultimate GopherLabs Hands-on Labs / Join GopherLabs Com

Dec 7, 2022
Comments
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

  • .OrderBy return panic when collection only contains one data

    .OrderBy return panic when collection only contains one data

    sample code: https://gist.github.com/wnitya2/f0e7ba5c648b7b5b4019da016f5cc425

    when collection only contains 1 data, e.g:

    data := []HashMap{
    		{ "name": "tim", "hobby": "stay awake all the time" },
    }
    
    result, err := gubrak.OrderBy(data, func(each HashMap) string {
    		return each["name"]
    })
    
    

    error returns:

    fatal error: all goroutines are asleep - deadlock!

    goroutine 1 [chan send]: github.com/novalagung/gubrak.OrderBy.func1.1(0x4df3c0, 0xc042002400, 0x97, 0xc04203c120) D:/Go/src/github.com/novalagung/gubrak/collection.go:888 +0xd9 github.com/novalagung/gubrak.OrderBy.func1(0x4df3c0, 0xc042002400, 0x4e8780, 0x510aa0, 0x0, 0x0, 0x0, 0xc0420301c0, 0x0, 0x0) D:/Go/src/github.com/novalagung/gubrak/collection.go:1048 +0x4e6 github.com/novalagung/gubrak.OrderBy(0x4df3c0, 0xc042002400, 0x4e8780, 0x510aa0, 0x0, 0x0, 0x0, 0xc042068060, 0xc04205bf50, 0x4c9db2, ...) D:/Go/src/github.com/novalagung/gubrak/collection.go:1054 +0x9d main.main() D:/Go/src/github.com/wnitya2/gubrak-error-orderby/main.go:15 +0x1cd exit status 2

  • same error

    same error

    Hello , I'm reading you codes these days,but ,unfortunately i saw some errors in you return values. For example,the func Concat,the right return value is :[1 2 3 4 4 6 7 8 9] func TakeRight, the right return value is :[5 6 7 8 9]

A library providing useful functional programming helpers for Go 1.18

Underscore underscore is a Go library providing useful functional programming helpers without extending any built-in objects. It is mostly a port from

Dec 29, 2022
This is my first golang project. The main reason for its existence is the need for practice. I will be studying golang while writing this project

My first GoLang project Project Aim The goal of this project is to develop the most simple golang bot to learn how to work with this programming langu

Jan 7, 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

Sep 1, 2022
Go from the beginning - A book on Go, contains fundamentals but also recipes

Go from the beginning Welcome to Go from the beginning, a free book containing 25+ lessons that will take you from "zero to hero" in the amazing langu

Dec 28, 2022
Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Webex Assistant Skills - Go This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. It is in

Oct 29, 2021
Simple Notifier/Listener utility package to pass around messages in-memory

Simple Observer (go) A small simple library to use for sending around messages in-memory. It uses a notifier/listener style messaging. Installation go

Dec 7, 2021
This project is a collection of many of the basic tools used on Unix-like operating systems implemented in Go as a learning exercize.

GoUnix This project is a collection of many of the basic tools used on Unix-like operating systems implemented in Go as a learning exercize. The idea

Jul 21, 2022
This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Dec 5, 2022
Clarifai - Clarifai library for Golang

Clarifai Golang Library Library for our v1 API. Disclaimer This API client only

Sep 27, 2022
Go-integrals - A numerical integration library in GoLang

Go Integrals About Go Integrals is an implementation of numerical integration al

Jan 19, 2022