Moving from 'master' to 'main' in Git with local changes

Interfaces 101 : Parsing Command Flags Ep. 9

Introduction In episode 8, Miki developed a Go HTTP client that had a method to check the health of a theoretical API. The method would construct the request URL and return an error based on the response code received from the server. Miki then created a type that would mock Goâ€...

Go on the Xbox?

#​453 — March 24, 2023 Unsub  |  Web Version The Go Weekly Newsletter Make Your Go Programs Use Less Memory.. Maybe — betteralign is a tool to detect structs that would use less memory if their fields were sorted and to then, optio...

Interfaces 101 : Testing with a Mock Interface Ep. 8

Introduction In episode 7, Miki discussed design considerations to keep in mind while creating interfaces in Go with the first idea he proposed being that an interface should represent what we need from a type, and not what is stored on the type. To add some clarity to this thoug...

The power of single-method interfaces in Go

The other day I was pondering on the prevalence of single-method interfaces (SMI) in Go, and what makes them so effective and useful. SMIs have proven to be a very successful software modeling tool for Go programmers, and you find them all over Go code-bases. I tried to think abo...

Structured logging is a go

#​452 — March 17, 2023 Unsub  |  Web Version The Go Weekly Newsletter FlameScope: Visualize CPU Samples from Go Execution Traces — FlameScope is a performance visualization tool from Netflix using flame graphs that can now be used...

A generic Set type in Go

To celebrate the first anniversary of generics in Go, let’s build something practical and useful: a generic Set type, and add some neat methods to it. Ready for fun?

Interfaces 101 : Interface Design Considerations Ep. 7

Introduction In episode 6, Miki built a logger package with the aim of making it as versatile as possible. To achieve this, he constructed his logger object with a function that would: accept the io.Writer interface as a parameter and perform type assertions to retrieve other int...

Sum of same-frequency sinusoids

I was reviewing an electronics textbook the other day, and it made an offhand comment that "sinusoidal signals of the same frequency always add up to a sinusoid, even if their magnitudes and phases are different". This gave me pause; is that really so? Even with differe...

The journey to faster JSON parsing

#​451 — March 10, 2023 Unsub  |  Web Version The Go Weekly Newsletter Why Turborepo is Migrating From Go to Rust — Turborepo is a high performance JavaScript build system built upon Go but.. perhaps not for much longer. Why? It mos...