All Articles

Using the Service Object Pattern in Go

Developing a web application without separating the logic used to parse an incoming request from the actual application logic can be painful. It is hard to test your card, dependencies aren't clear, and the code can become a mess. Learn how to apply the service object pattern to your Go code in order to properly isolate these concerns, making it easier to test, maintain, and read your code.

Concatenating and Building Strings in Go 1.10+

Go 1.10 introduced the new strings.Builder type, which can be used to efficiently and easily build or concatenate strings. In this post we explore some of the ways to use the type as well as why it implementing the io.Writer interface makes it an incredibly powerful tool.

Exploring vgo

Yesterday Russ Cox announced vgo, a drop in replacement for the go tool designed to handle package versioning. While it is still an experiment, it is a pretty unexpected change given that everyone thought dep was going to become the official dependency management tool. If you haven’t already, you should start by reading Russ’ post as well as the tour he provides. It is a great overview of what vgo is, even if many people have misinterpreted a few things in the post.

When Should I Use One Liner if...else Statements in Go?

After using Go for a few weeks, chances are you are going to run across a single-line if...else statement. Most often, you will see this with an err (eg if err := doStuff(); err != nil { ... }). This article discusses the situations where a one-liner is appropriate, and ones where it isn't a great fit.

The New Website is Live

Gopher Image by Egon Elbre After quite a bit of time redoing my site, the new version is now ready for prime time. The new version is powered by Hugo, which is a static site genreator written in Go. It was previously powered by Ghost which is a little different, so if you see any dead links or anything like that let me know. Changing to Hugo allowed me to make quite a few changes that aren’t purely cosmetic.

Disabling Specific Snippets (autocompletions) in Atom

I run into this issue a lot so I wanted to document how I handle it for others who are experiencing the same issue. Let’s imagine you install this new package in Atom like GitHub flavored Markdown and it enables a snippet that you don’t like. In my case it was the code snippet which expands into the triple tildes (```) used for code samples in a markdown file. The first thing you want to do is figure out what source the snippet was introduced under.

Avatar of Jon Calhoun
Articles and Tutorials by
Jon Calhoun

Jon Calhoun is a full stack web developer who also teaches about Go, web development, algorithms, and anything programming related. He also consults for other companies who have development needs. (If you need some development work done, get in touch!)

Jon is a co-founder of EasyPost, a shipping API that many fortune 500 companies use to power their shipping infrastructure, and prior to founding EasyPost he worked at google as a software engineer.

Jon's latest progress update: Writing Course Notes

Recent Articles All Articles Mini-Series Progress Updates Tags About Me Go Courses

©2018 Jonathan Calhoun. All rights reserved.