Member-only story

5 Useful Golang Modules Developers Should Know in 2022

These Go modules will save you a lot of time

Bryan Dijkhuizen
3 min readNov 11, 2021
two women analyzing computer code on a laptop
By Christina Morillo on Pexels

Go is an incredibly powerful and versatile language for multiple purposes. It’s reliable, fast, and easy to use.

Golang has fantastic documentation. Go also is very easy to scale. Today, we look into the best Go modules to make working with Go even easier. So here’s a list of ten useful Go modules!

Gen

Gen is a tool that actually generates code for you, how handy? It’s intended to offer generics-like functionality on your types.

screenshot of Gen from GitHub
Gen — Github

Installing the module

Run the following command:

go get github.com/clipperhouse/gen

How to use it

To use this module you first create a new Go project and define a type:

// +gen slice:"Where,Count,GroupBy[string]"
type MyType struct {}

And at the command line, simply type:

gen

You should see a new file, named mytype_slice.go.

--

--

Bryan Dijkhuizen
Bryan Dijkhuizen

Written by Bryan Dijkhuizen

Writing about the life of a neurodivergent creative in a neurotypical world. — https://bryandijkh.substack.com/

Responses (1)