An introduction to Packages, Imports and Modules in Go

This tutorial is written for anyone who is new to Go. In it we'll explain what packages, import statements and modules are in Go, how they work and relate to each other and — hopefully — clear up any questions that you have. We'll start at a high level, then work dow...

Determining missing translation keys from gettext `.po` files

If you're working with applications that require translations, you may be using gettext's .po format to store your translations. One issue I've found with this is that sometimes it can be hard to quickly audit whether there are any missing translations, especially in larger appli...

Interfaces 101 : Implementing Generics with Interfaces Ep. 1

Introduction Go interfaces are beneficial to Go developers because they: Allow interfaces to separate mechanism from behavior. Increase flexibility of function parameters. Enable mocking of function parameters. With the addition of generics in Go 1.18, interfaces can be used to...

Announcing GoReleaser v1.15 — the first of 2023

Keeping our pace of 1 minor a month, this is the January 2023 release. GoReleaser’s Ko integration documentation It is packed with some juicy features and tons of bug fixes and quality-of-life improvements. Let’s take a look: Highlights GoReleaser Pro now...

I should assume contexts aren't retained in Go APIs

Ultimate Go: Advanced Engineering Episode 20

Introduction In episode 19, Bill designed and implemented the data structure for an account on his blockchain. This type will have a nonce field to ensure incoming transactions are valid and performed in order. Since the database will be stored in memory and not on disk, the bala...

The gentle art of code review

Could we give and receive code reviews with kindness, gentleness, humility, and compassion? Can we make a point without making an enemy? Let’s go line by line.

Ultimate Go: Advanced Engineering Episode 18

Introduction In episode 17, Bill began to design an in-memory accounting database that will store the account balances on his blockchain. To build this database, Bill will add a memory pool on each node that stores a list of public addresses with their respective balances. The ba...

Ultimate Go: Advanced Engineering Episode 19

Introduction In episode 18, Bill defined the Go type that will represent a transaction and implemented the methods to validate one. While developing the transaction type, Bill states that he’ll be borrowing concepts from Ethereum to ensure that he’s building a reference imple...

Table driven tests in Go

Introduction Table tests are a great way to test different inputs and associated outputs for a function in Go. To write a table test, you define a slice of some data struct with fields of the input data you’ll need and the expected outcome. Then you can loop through this slice...