Now that Golang has generic types, how do you plan to use them?

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
  • aws-sdk-go

    AWS SDK for the Go programming language.

  • I don't think so. Not in the AWS API. They're used in places where no unset is possible. Here's one example: accessing s3, the name of the bucket you're accessing is not optional. Yet, from github.com/aws/aws-sdk-go/services/s3/api.go (which is too large a file for github to render and allow me to link to the right line, so I'll just quote the relevant part here) it's passed in as a *string:

  • surf

    CLI Text Search across your infrastructure platforms, Universal Ctrl+F for infra (by Isan-Rivkin)

  • I created an open source CLI tool I’ve always wanted and based it on generics https://github.com/Isan-Rivkin/surf

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

    Compile-time Dependency Injection for Go

  • The same old story we had even if DI pattern is not supported in Go. But some cant live without it and they need libs like https://github.com/google/wire to auto-generate that code.

  • mu8

    Genetic algorithm for unsupervised machine learning in Go.

  • https://github.com/soypat/mu8 machine learning library which returns the optimized user type generically instead of as a interface{}. See Champion() method

  • go-maquina

    Small finite-state machine library for Go

  • https://github.com/soypat/go-maquina finite state machine which takes user callbacks with a generically defined input argument to the callback. See fringeFunc[T]

  • golang-generics-dao-example

    Example using Generics with DAO

  • My example: https://github.com/num8er/golang-generics-dao-example

  • generic-client

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

    A in-process MapReduce library to help you optimizing service response time or concurrent task processing. (by kevwan)

  • https://github.com/kevwan/mapreduce (finished, and some users are using it)

  • stream

    Stream API for Go. (by kevwan)

  • https://github.com/kevwan/stream (cannot be done with generics, due to lack of template method support)

  • go-zero

    A cloud-native Go microservices framework with cli tool for productivity.

  • https://github.com/zeromicro/go-zero (because we support early to Go 1.15, generics is impossible to be used at the moment)

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