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.
Ben Johnson

Ben Johnson

Freelance Go developer, author of BoltDB

Go Walkthrough: encoding/binary

When you need to squeeze every last bit or CPU cycle out of your protocol, one of the best tools is the encoding/binary [https://golang.org/pkg/encoding/binary/] package. It operates on the lowest level and is built for working with binary protocols. We previously looked at using

Ben Johnson
Ben Johnson
Go Walkthrough

Go Walkthrough: encoding/json

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

Go Walkthrough: encoding

So far we’ve covered working with raw byte streams and bounded byte slices but few applications simply shuttle bytes around. Bytes alone don’t convey much meaning, however, once we encode data structures on top of those bytes then we can build truly useful applications. This post is part

Ben Johnson
Ben Johnson
Go Walkthrough
Standard Package Layout

Standard Package Layout

Vendoring. Generics. These are seen as big issues in the Go community but there’s another issue that’s rarely mentioned — application package layout. Every Go application I’ve ever worked on appears to have a different answer to the question, how should I organize my code? Some applications push

Ben Johnson
Ben Johnson
Application Design

Go Walkthrough: bytes + strings

In the previous post we covered byte streams but sometimes we need to work with bounded, in-memory byte slices instead. While working with a list of bytes seems simple enough, there are a lot of edge cases and common operations that make using the bytes [https://golang.org/pkg/bytes/

Ben Johnson
Ben Johnson
Go Walkthrough

Go Walkthrough: io

Go is a programming language built for working with bytes. Whether you have lists of bytes, streams of bytes, or individual bytes, Go makes it easy to process. From these simple primitives we build our abstractions and services. The io package is one of the most fundamental packages within the

Ben Johnson
Ben Johnson
Go Walkthrough

Structuring Applications in Go

For me, the hardest part of learning Go was in structuring my application. Prior to Go, I was working on a Rails application and Rails makes you structure your application in a certain way. “Convention over configuration” is their motto. But Go doesn’t prescribe any particular project layout or

Ben Johnson
Ben Johnson
Application Design