Wrapping Errors in Go – How to Handle Nested Errors

photo 1495863367063 b9ac3e6394f7

Errors in Go are a hot topic. Many newcomers to the language immediately level their first criticism, “errors in go are clunky! Let me just use try/catch!” This criticism is well-meaning but misguided. The paradigm of errors as a type, rather than something to be thrown and cause panics, allows for more control of how … Read more

Top 6 Golang Logging Best Practices

guest writing on table

Let’s cover some rules of thumb for logging in Go, as well as some functions you may not have heard of that can make your debugging life easier. Best practices for logging in Go aren’t super obvious, and sometimes we have to take a deeper look to see what the best choice is given Go’s … Read more

How to Create Constant Maps, Slices, & Arrays in Golang

How to Create Constant Maps and Slices in Go

For the most part, I’ve noticed that Go developers are pretty good about using global constants for configuration, rather than global variables. A problem arises however when we want a constant version of some of the more complex types. The Go compiler doesn’t allow array, map, or slice constants. Many developers, upon making this realization, … Read more

The Proper Use of Pointers in Go (Golang)

photo 1497005367839 6e852de72767

Go has become increasingly popular in recent years, especially in my local area. It has been consistently displacing other backend languages like Ruby, Python, C# and Java. Go is wanted for its simplicity, explicitness, speed, and low memory consumption. Many developers that are new to the language, or new to a language that can handle … Read more