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: Go 1.22 Release Notes | news.ycombinator.com | 2024-02-06

    On the other hand, I advise you NOT to use this kind of library and write simple, fast go code most of the time, with the occasional generics helper. Why the hell would I clutter my code with, for example: https://github.com/samber/lo?tab=readme-ov-file#fromentries-...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • golang-set

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

  • lancet

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

    Project mention: Show HN: A comprehensive, efficient, and reusable util function library of Go | news.ycombinator.com | 2024-02-20
  • 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.

  • 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!

  • gomacro

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

  • pie

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

  • SaaSHub

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

    SaaSHub logo
  • do

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

  • gen

    Type-driven code generation for Go (by clipperhouse)

  • generic

    A collection of generic data structures written in Go.

  • goderive

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

  • 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

    Project mention: One Billion Row Challenge in Golang - From 95s to 1.96s | dev.to | 2024-03-17

    Time to deal with the large elephant in the room, the runtime.mapaccess2_fast64 map lookup. Despite spending some hours of research, I couldn't found any viable way to optimize the builtin map. However, there is a community alternative called Swiss Map, which sells itself as faster and more memory efficient than the builtin one. Replacing it is almost a drop-in, with just some syntax changes:

  • go-generics-cache

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

  • 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
  • genesis

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

  • async

    Synchronization and asynchronous computation package for Go (by reugn)

  • functools

    Functional tools in Go 1.18 using newly introduced generics

  • slices

    fast generic sort for slices in golang (by PeterRK)

  • 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+.

  • go-optional

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

  • assert

    A simple assertion library using Go generics (by alecthomas)

  • 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

  • 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
  • Functional Programming Library for Golang by IBM

    8 projects | news.ycombinator.com | 17 Aug 2023
  • A lightweight Golang generics library that provides Map, Reduce and more

    1 project | /r/golang | 17 Aug 2023
  • A lightweight Golang generics library that provides Map, Reduce and more

    1 project | news.ycombinator.com | 14 Aug 2023
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 20 Jul 2024
    Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more →

Index

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

Project Stars
1 lo 16,187
2 golang-set 4,019
3 lancet 3,857
4 mo 2,450
5 rueidis 2,258
6 gomacro 2,150
7 pie 1,886
8 do 1,709
9 gen 1,430
10 generic 1,277
11 goderive 1,213
12 ttlcache 887
13 swiss 705
14 go-generics-cache 453
15 enum 360
16 genesis 337
17 async 200
18 functools 176
19 slices 171
20 orm 156
21 gostream 153
22 go-optional 140
23 assert 137

Sponsored
Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com