When I'm building a web application in Go, I prefer to use command-line flags to pass configuration settings to the application at runtime. But sometimes, the client I'm working with wants to use environment variables to store configuration settings, or the nature of the project means that storing settings in a TOML, YAML or JSON file is a better fit. And of course that's OK — it makes sense to be flexible and vary how configuration is managed based on the specific needs of a project and/or...| www.alexedwards.net
A description of range over function types, a new feature in Go 1.23.| go.dev
I added one small function and kept out one small package.| blog.carlana.net
I’m a fan of Mat Ryer’s work, and his blog posts have had a significant impact on the way I program in Go. I found the book hit or miss. Some chapters were fascinating and taught me valuable Go lessons, while others felt boring and got too bogged down in the minutiae of third-party libraries. Overall, I’d still recommend it to anyone who considers themselves a beginner or intermediate Go programmer.| mtlynch.io
One of the things I enjoy about Go is its standard library, which comes with batteries included. Sure, some packages (like flag) aren’t as powerful or ergonomic as the available alternatives but I’m generally willing to accept this in order to avoid dependencies. Testing The same also applies to Go’s built-in test support, the testing package. Let’s look at a typical test: package example import "testing" func Add(a, b int) int { return a + b } func TestAdd(t *testing.| citizen428.net