You've successfully subscribed to Go Beyond
Great! Next, complete checkout for full access to Go Beyond
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Packages as layers, not groups
Members Public

Four years ago, I wrote an article called Standard Package Layout that tried to address one of the most difficult topics for even advanced Go developers: package layout. However, most developers still struggle with organizing their code into a directory structure that will grow gracefully with their application. Nearly all

Ben Johnson
Ben Johnson

Introducing WTF Dial (again)
Members Public

A blog series where we build and deploy a real-world Go application.

Ben Johnson
Ben Johnson
WTF Dial

The Go Object Lifecycle
Members Public

Despite such a simple language, Go developers have found a surprising number of ways to create and use objects. In this post we’ll look at a 3-step approach to object management—instantiation, initialization, & initiation. We’ll also contrast this with other methodologies for creating and using objects and

Ben Johnson
Ben Johnson
Application Design

Failure is your Domain
Members Public

Go’s paradox is that error handling is core to the language yet the language doesn’t prescribe how to handle errors. Community efforts have been made to improve and standardize error handling but many miss the centrality of errors within our application’s domain. That is, your errors are

Ben Johnson
Ben Johnson
Application Design

Go Walkthrough: fmt
Members Public

In the last post we looked at fast, primitive encoding using strconv but in this post we’ll take a higher level approach by using templates with the fmt package. The fmt package builds on top of our knowledge of primitive formatting options but packages it in a way that’

Ben Johnson
Ben Johnson
Go Walkthrough

Go Walkthrough: strconv
Members Public

Formatting & parsing primitive values in Go is a common task. You probably first dipped your toes into the fmt package when you started Go, however, there’s a less commonly used package for basic formatting that’s more efficient and preserves compiler type checking. The strconv package is built

Ben Johnson
Ben Johnson
Go Walkthrough

Go Walkthrough: encoding/binary
Members Public

When you need to squeeze every last bit or CPU cycle out of your protocol, one of the best tools is the encoding/binary package. It operates on the lowest level and is built for working with binary protocols. We previously looked at using encoding/json for text-based protocols but

Ben Johnson
Ben Johnson
Go Walkthrough

Go Walkthrough: encoding/json
Members Public

For better or for worse, JSON is the encoding of the Internet. Its formal definition is small enough that you could write it on the back of a napkin but yet it can encode strings, numbers, booleans, nulls, maps, and arrays. Because of this simplicity, every language has a JSON

Ben Johnson
Ben Johnson
Go Walkthrough