Go Generics

Open-source Go projects categorized as Generics

Top 23 Go Generic Projects

  • lo

    💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)

    Project mention: Functional Programming Library for Golang by IBM | news.ycombinator.com | 2023-08-17

    A simple alternative is the combination of:

    - https://github.com/samber/lo

    - https://github.com/samber/mo

    The split is also nice as you can choose to just use the generic convenience functions from lo without the more FP related things from mo.

  • golang-set

    A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp.

    Project mention: Is there something similar to blessed.rs ? | /r/golang | 2023-01-01

    If it were true, there wouldn't be any 3rd-party libs for Go and everybody used just the stdlib. For instance, if you need a set, you can use https://github.com/deckarep/golang-set . Of course, you can do it with the stdlib with map, but if you don't want to do that, use golang-set . I think Python has a much larger stdlib and yet, Python has tons of 3rd-party packages.

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • lancet

    A comprehensive, efficient, and reusable util function library of Go.

    Project mention: lancet: A powerful utils function lib of go | /r/golang | 2022-11-30
  • gomacro

    Interactive Go interpreter and debugger with REPL, Eval, generics and Lisp-like macros

    Project mention: Go superset | /r/golang | 2023-05-19

    gomacro added macros and generics several years before generics reached release.

  • rueidis

    A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.

    Project mention: Show HN: A Cache-Aside Pattern Implementation Enhanced by Client Side Caching | news.ycombinator.com | 2023-07-16
  • mo

    🦄 Monads and popular FP abstractions, powered by Go 1.18+ Generics (Option, Result, Either...)

    Project mention: Functional Programming Library for Golang by IBM | news.ycombinator.com | 2023-08-17

    A simple alternative is the combination of:

    - https://github.com/samber/lo

    - https://github.com/samber/mo

    The split is also nice as you can choose to just use the generic convenience functions from lo without the more FP related things from mo.

  • pie

    🍕 Enjoy a slice! A utility library for dealing with slices and maps that focuses on type safety and performance. (by elliotchance)

  • Mergify

    Tired of breaking your main and manually rebasing outdated pull requests?. Managing outdated pull requests is time-consuming. Mergify's Merge Queue automates your pull request management & merging. It's fully integrated to GitHub & coordinated with any CI. Start focusing on code. Try Mergify for free.

  • do

    ⚙️ A dependency injection toolkit based on Go 1.18+ Generics.

    Project mention: Google’s Wire: Automated Dependency Injection in Go | /r/golang | 2023-02-18
  • generic

    A collection of generic data structures written in Go.

    Project mention: Go 1.20: memory arenas | dev.to | 2023-02-03

    You might also consider using other data structures instead of slices, for example, a linked list can be grown without an issue.

  • goderive

    Derives and generates mundane golang functions that you do not want to maintain yourself

    Project mention: Do you generate Clone or Copy methods? | /r/golang | 2023-03-18

    I found https://github.com/awalterschulze/goderive but haven't used anything like it besides mockgen

  • ttlcache

    An in-memory cache with item expiration and generics

    Project mention: v3.1.0 of ttlcache - an in-memory cache with item expiration and generics | /r/golang | 2023-08-25
  • swiss

    Golang port of Abseil's SwissTable (by dolthub)

    Project mention: SwissMap: A Golang Port of SwissTable | news.ycombinator.com | 2023-03-30
  • go-generics-cache

    A key:value store/cache library written in Go generics. LRU, LFU, FIFO, MRU, Clock support.

    Project mention: GitHub - Code-Hex/go-generics-cache at v1.3.0 | /r/golang | 2023-04-17
  • genesis

    All generic functions for Go you ever need! (by life4)

    Project mention: Iterium - Generic Channel-based Iterators (opensource project) | /r/golang | 2023-03-13

    what's new/diff from https://github.com/life4/genesis ?

  • enum

    Type safe enums for Go without code generation or reflection (by orsinium-labs)

    Project mention: Enum: Type safe enums for Go without code generation or reflection | news.ycombinator.com | 2023-08-30
  • kago

    KaGo

    Project mention: Does Go have an equivalent to Python's Flask and Django? | /r/golang | 2022-12-08

    The closest I’ve seen is https://github.com/kamalshkeir/kago it’s not only building the restful part but also the ORM using Go generics to match día go behavior. It even supports migrations

  • functools

    Functional tools in Go 1.18 using newly introduced generics

  • async

    Synchronization and asynchronous computation package for Go (by reugn)

    Project mention: [async] When the standard sync is not enough | /r/golang | 2022-11-28
  • orm

    A lightweight yet powerful, fast, customizable, type-safe object-relational mapper for the Go programming language. (by golobby)

  • gostream

    A Go port of the Java Streams API. Type-safe and functional Go Streams processing for Go 1.18+.

  • assert

    A simple assertion library using Go generics (by alecthomas)

    Project mention: Libraries you use most of your projects? | /r/golang | 2022-11-02

    https://github.com/alecthomas/assert As an assertion library

  • lru

    LRU cache using go generics

  • go-monads

    experimental implementation of basic monads based on go2 generics draft

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-08-30.

Go Generics related posts

Index

What are some of the best open-source Generic projects in Go? This list will help you:

Project Stars
1 lo 13,287
2 golang-set 3,486
3 lancet 3,007
4 gomacro 2,077
5 rueidis 1,877
6 mo 1,792
7 pie 1,719
8 do 1,250
9 generic 1,187
10 goderive 1,129
11 ttlcache 714
12 swiss 514
13 go-generics-cache 341
14 genesis 305
15 enum 204
16 kago 183
17 functools 175
18 async 144
19 orm 143
20 gostream 132
21 assert 118
22 lru 116
23 go-monads 108
Clean code begins in your IDE with SonarLint
Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
www.sonarlint.org