RSSAmplifier

Blog

lesiw.dev

The technical blog of Chris Lesiw, a Go developer with a focus on building simple, robust, and sustainable software.

lesiw.devRSS feed ↗17 posts

Latest posts

Many-Step Sequences in Go

Breaking up programs with lots of linear steps.

An overview of Go structs

An overview of Go structs: fields, tags, empty structs, size optimization, anonymous declarations, and embedding.

repo: A tiny solution for a tiny problem

I wrote a small program to answer the question, "Now where did I put that code?"

Don't defer in tests

Deferring is a useful mechanism in most of Go, but in tests, there's a better way.

golang-announce RSS feed

The golang-announce Google group wasn't available as an RSS feed, so I wrote a small program to fix that. Here's the feed if you'd also like to use it.

Go review references

A collection of Go wisdom for easy access and sharing during code review.

Go proverbs

A transcription of the Go Proverbs talk given by Rob Pike at Gopherfest 2015.

Limit line length

Want a codebase that's easier to read, maintain, and extend? Enforce a line length limit.

Add methods to anything

Go methods don't have to be declared on structs.

Single-binary Docker images

Go applications are very self-contained. So self-contained, in fact, that they can act as their own Docker container!

Build your own stacktrace

Go doesn't come with stacktraces. It encourages you to build your own.

Git notes

Recommended git configurations and other tips.

Structs are configuration

The "functional options" pattern in Go is very silly. Here's an easier alternative.

Done channels

If you need multiple goroutines to wait for the same thing, use a done channel.

Error handling in main()

What's the right way to handle errors in the main function?

For/Else in Go

Python has a handy for/else construction. Go has an equivalent.

Go testing tips

This page collates some strategies I've found useful when testing Go programs.