Comprehensive Guide to Dates and Times in Go

clock

Keeping track of time in code has long been every developer’s nightmare. While no language or package manages time perfectly, I think Golang does a pretty good job out-of-the-box. This full tutorial should answer ~90% of the questions you’ll have about time management in Go. Table of Contents Overview – How dates and times are …

Read more

Continuous Deployments != Continuous Disruptions

stream running down hill continuous

Luckily, I’ve met very few engineers in my career who are outright opposed to continuous deployment. That said, I have met some, and I think their hesitation is usually rooted in the myth that continuous causes more disruptions to end-users than a batched release cycle. What is continuous deployment? Before we get into the nitty-gritty …

Read more

The 10x Meeting – Solving for Too Many Meetings

meetings on couch

Perhaps you’ve heard of the fabled 10x developer (or 10x engineer) – the one on the team that’s 10x as productive as their average colleague. While many, including myself, doubt the existence of such people, I do think there are meetings that are 10x as productive as the average meeting. My goal in this article …

Read more

Concatenating with strings.Builder Quickly in Golang

knot in string unsplash

The Go standard library makes concatenating strings easy. Concatenation is just a fancy word for adding strings together to make a larger string. For example, if we concatenate “hello”, ” ” and “world” we’d get “hello world”. The built-in fmt.Sprintf function takes a format and a variadic list of interfaces as input. The formatting option …

Read more

The Ultimate Guide to JSON in Go

json data

As a language designed for the web, Go provides extensive support for working with JSON data. JSON (JavaScript Object Notation) is an incredibly popular data exchange format whose syntax resembles simple JavaScript objects. It’s one of the most common ways for applications to communicate on the modern web. Table of Contents Encoding and decoding with …

Read more

Search and Replace Strings in Golang – Top 5 Examples

replace lightbulb

Go has a powerful standard library that makes string manipulation easy right out of the box. One of the functions I use most often is the strings package’s Replace() function. strings.Replace() returns a copy of its input string after replacing all instances of the given substring with a new one. strings.Replace() signature Notes s is …

Read more

How and Why to Write Enums in Go

list with pencil and paper

An enum (short for enumerator), is a set of named constant values. An enum is a powerful tool that allows developers to create complex sets of constants that have useful names and yet simple and unique values. Syntax Example Within a constant declaration, the iota keyword creates enums as successive untyped integer constants. Why should you use enums? …

Read more

Splitting a String into a Slice in Golang

splitting a lemon

I can’t begin to tell you how often I split strings in Go. More often than not I’m just parsing a comma-separated list from an environment variable, and Go’s standard library gives us some great tools for that kind of manipulation. Table of Contents Split by commas or other delimiters strings.Split strings.SplitN Split by delimiters …

Read more

Backend Developers are UX Designers Too

design notebook

Too often I neglect the idea of UX design in backend work. The goal of user experience design is to give users a product that’s easy to use. In the world of front-end development, that typically means making it obvious how to navigate your site, using commonly-understood icons, or implementing well-contrasted colors for foreground and …

Read more