Hi, I’m Ricky, one of Twilio’s Brooklyn based Developer Evangelists. One of my favorite tips from The Pragmatic Programmer is to learn at least one new language every year. To challenge myself in 2014, I’m learning Go. There were a few things that got me excited to try Go: it’s open-source, runs on many platforms (OSX, Linux, Windows) and has an adorable gopher named Gordon as its mascot. By following this post, you will learn how to build a basic Go app that sends an SMS message using Twilio. If you like spoilers, you can look at the gist of the final code.

Recipes

Before we dive into code, there are a few dependencies you’ll need:

an environment running Go : Installation instructions.

a Twilio account : Sign up for free.

Need to set these up? Go ahead, I don’t mind waiting. I have some episodes of Brooklyn Nine-Nine to catch up on.

The Adventure Begins

Now that you have your tools ready to go, let’s get started. If this is your first time using Go we’ll walk through some of the basics in this post but I’d highly recommend checking out the official Go programming language tour. Here’s the initial program we’ll be starting with: