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.

Go Walkthrough

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

Go Walkthrough: encoding
Members Public

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

Go Walkthrough: bytes + strings
Members Public

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 package worthwhile. We’re also

Ben Johnson
Ben Johnson
Go Walkthrough

Go Walkthrough: io
Members Public

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