Learning to Go: Part 1 - Introduction

Search for a command to run...

No comments yet. Be the first to comment.
Learn to write Go code by creating a basic web app that will provide a front-end for a public API
Oh hi! This is a multi-part tutorial series, please make sure you reads the posts in order! You can find the list at the bottom of the page. We'll start by creating a new file called main.go, and writing our first line: package main All Go programs ...
Next up in my quest to Learn All The Things™ on the CNCF graduated projects page, we’re going to take a look at a lesser known Argo project: Argo Rollouts. In a nutshell, Argo Rollouts are a drop-in replacement for the Deployment object that provide ...

Continuing my efforts to explore and Learn All The Things™ on the CNCF graduated projects page, today I’m going to take a look at Argo Workflows, which is one of 4 tools in the Argo project overall (see my previous post on ArgoCD). Argo Workflows is ...

In my never-ending quest to Learn All The Things™, I’ve decided to take a tour through the Cloud Native Computing Foundation’s graduated projects page. I’m doing this for a few different reasons: Lea

This is the tenth post in a series exploring the features of GKE Enterprise, formerly known as Anthos. GKE Enterprise is an additional subscription service for GKE that adds configuration and policy management, service mesh and other features to supp...

This is the ninth post in a series exploring the features of GKE Enterprise, formerly known as Anthos. GKE Enterprise is an additional subscription service for GKE that adds configuration and policy management, service mesh and other features to supp...

Hello fellow Go newbies! That’s right, I’ve decided to add yet another Go tutorial to the Internet. I’ve been attempting to learn Go for a while now, and found that existing tutorials are either esoteric deep-dives into Go’s advanced features, or pedestrian walkthroughs of every single statement in the language, in order. I needed a tutorial that would actually teach me to do something useful, so I decided to write one.
In this series of posts we will create a basic web application that will provide a front-end for a public API. Why? Talking to APIs and providing HTTP services are fundamental parts of building microservices. They’re also quite common coding challenges that come up in job interviews :-)
In honour of Star Trek Picard launching this month, we’re going to create a Star Trek themed search engine that looks up dialog from Star Trek: The Next Generation (huge thanks to this dataset). Wait, should I have called this series “Make it Go?”

Again, to clarify, this is not a complete guide to Go. Rather it’s a tutorial to get you to actually build something, and get a feel for the language along the way. Once you complete this tutorial I’d expect you to go onto one of the more in depth or advanced guides out there on the web. This is also not a complete beginners guide, I’m assuming you have some experience with programming and are familiar with basic types, flow control etc.
To follow along, make sure you have Go installed and an editor/IDE set up and ready to, erm, go. There’s some instructions here that may help. In each stage I’ll go through every line of code we need to write and explain what it’s doing, then I’ll post the entire file in a gist at the end of the post so you can check your code for mistakes.
Let’s get started!