Do you use generics?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • bob

    SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite (by stephenafamo)

  • I'm using generics heavily in Bob, a query builder and ORM generator

  • lo

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

  • mostly this https://github.com/samber/lo

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • btree

    AVL balanced generic binary trees in Go (by VictorLowther)

  • Generally when I feel like revisiting some CS staples and working out how to implement them idiomatically with generics. https://github.com/VictorLowther/btree is an example of this.

  • go-sql-builder-benchmarks

    Benchmarking Golang SQL query builders

  • However, from my benchmarks, Bob is generally faster at query building than comparable packages see benchmarks. For the ORM portions, I'm still working on the benchmarks, but it seemed quite good in my initial tests.

  • Mantis

    Sphire Mantis is a broadly featured Go helper library with standalone packages (by sphireinc)

  • Some basic math functions: https://github.com/sphireinc/Mantis/blob/master/helper/math.go

  • sage

    Discontinued Trie data structure for storing and retrieving HTTP route values. Used for building Go HTTP router packages. (by nahojer)

  • I used generics in a package for building HTTP routers using a trie data structure. The generic type represent the Handler func of the routes trie, but I wanted the consumer to be able to choose the signature for the handler. For example, they might want to define their own handler func type that returns an error, or perhaps take some arbitrary extra argument. Checkout https://github.com/nahojer/sage to learn more.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts