Go Generics

Open-source Go projects categorized as Generics

Top 23 Go Generic Projects

  1. lo

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

    Project mention: Fun with Go Iterators | news.ycombinator.com | 2024-10-10

    Might be interesting to make a library that competes with https://github.com/samber/lo?

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. lancet

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

  4. golang-set

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

  5. mo

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

  6. rueidis

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

    Project mention: Maintain chat history in generative AI apps with Valkey | dev.to | 2024-07-01

    It's important to note that it's possible to use any Redis-compatible client with Valkey. I used the go-redis client, but (at the time of writing) there is work underway to build Valkey specific client libraries. Check the Valkey GitHub org to take look at the forks of existing Redis client libraries such as valkey-go (corresponding to rueidis), iovalkey (corresponding to ioredis), Jackey (corresponding to jedis) etc. These are very early days (at the time of writing), and it will be interesting to see the progress here!

  7. gomacro

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

    Project mention: Faster interpreters in Go: Catching up with C++ | news.ycombinator.com | 2025-04-05

    do a type analysis on each expression you want to "compile" to a closure, and instantiate the correct closure for each type combination.

    Here is a pseudocode example, adapted from https://github.com/cosmos72/gomacro/blob/2ff796e3da1057c005c...

    /* return a closure that computes x + y when executed /

  8. do

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

    Project mention: Do: A dependency injection toolkit based on Go 1.18 Generics | news.ycombinator.com | 2024-07-24
  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. pie

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

  11. rill

    Go toolkit for clean, composable, channel-based concurrency (by destel)

    Project mention: Real-Time Batching in Go | dev.to | 2025-02-03

    To simplify the worker implementation, we'll use rill, a concurrency toolkit I’ve built. It provides utilities like rill.Batch, which groups incoming items into batches with a timeout (exactly as described earlier), and rill.ForEach, which helps control the level of concurrency when processing those batches. Thanks to these tools, the worker implementation becomes remarkably compact.

  12. gen

    Type-driven code generation for Go (by clipperhouse)

  13. generic

    A collection of generic data structures written in Go.

    Project mention: Go Is a Well-Designed Language | news.ycombinator.com | 2025-01-08

    Not sure how I didn't find this before, but https://github.com/zyedidia/generic looks like a decent library.

    Although there are some decent libraries out there for this kind of thing, my complaint mostly stems from the fact that a lot of existing code doesn't involve generics yet.

    I think I remember skimming an article about for range loops on Hacker News a while back, but again, my main complaint is still that existing code exists in a way that doesn't incorporate all these new features yet.

  14. goderive

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

  15. ttlcache

    An in-memory cache with item expiration and generics

  16. go-generics-cache

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

  17. enum

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

    Project mention: Enums in Go | news.ycombinator.com | 2024-07-12
  18. genesis

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

  19. async

    Synchronization and asynchronous computation package for Go (by reugn)

  20. go-optional

    A library that provides Go Generics friendly "optional" features.

  21. kod

    A generics based dependency injection application framework for Go, supporting aspect oriented programming based on interceptors (by go-kod)

  22. korm

    KORM, an elegant and lightning-fast ORM for all your concurrent and async needs. Inspired by the highly popular Django Framework, KORM offers similar functionality with the added bonus of performance

  23. functools

    Functional tools in Go 1.18 using newly introduced generics

  24. assert

    A simple assertion library using Go generics (by alecthomas)

  25. gostream

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

  26. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
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).

Go Generics discussion

Log in or Post with

Go Generics related posts

  • 1BRC Coding Challenge: Nerd Sniping the Java Community

    5 projects | news.ycombinator.com | 30 Oct 2024
  • Fun with Go Iterators

    11 projects | news.ycombinator.com | 10 Oct 2024
  • SwissTable: A High-Performance Hash Table Implementation

    3 projects | dev.to | 2 Oct 2024
  • One Billion Row Challenge in Golang - From 95s to 1.96s

    2 projects | dev.to | 17 Mar 2024
  • Golang Port of Abseil's SwissTable

    1 project | news.ycombinator.com | 16 Feb 2024
  • Go is not an easy language (2021)

    1 project | news.ycombinator.com | 14 Jan 2024
  • v3.1.0 of ttlcache - an in-memory cache with item expiration and generics

    1 project | /r/golang | 25 Aug 2023
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 18 Jun 2025
    InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now. Learn more →

Index

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

# Project Stars
1 lo 19,557
2 lancet 5,050
3 golang-set 4,527
4 mo 2,996
5 rueidis 2,691
6 gomacro 2,244
7 do 2,138
8 pie 2,002
9 rill 1,677
10 gen 1,427
11 generic 1,302
12 goderive 1,260
13 ttlcache 1,062
14 go-generics-cache 478
15 enum 424
16 genesis 349
17 async 248
18 go-optional 194
19 kod 185
20 korm 182
21 functools 172
22 assert 161
23 gostream 161

Sponsored
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com

Did you know that Go is
the 4th most popular programming language
based on number of references?