If you are familiar with programming and you know basic concepts like loops, variables, flow controls, and the like, then there are many resources available that can help you ramp up with Go real fast.
In this article, I’ll list some of those resources, and I’ll share my opinionated order to consume them.
Getting Your Feet Wet
One piece of advice that I can give you is to always keep in mind while learning Go is to unlearn what you have previously learned.
Most of the time, the “Go way” of doing things will be unique: Trying to mold it with patterns and paradigms that you’ve known from other programming languages will result in futile resistance.
Forget everything you know and embrace the Go way.
A Tour of Go
That clarified you can start with visiting A Tour of Go, an interactive tutorial that teaches you the fundamentals of the language in under a few hours.
Go Programming Language Specification
After finishing the tour, I would resist the temptation to start coding right away and read the Go Programming Language Specification. It’s amazingly human-readable as far as a spec goes, and it’s “the” authoritative source about how the program behaves, so don’t skip it; read the spec cover-to-cover at least once. Later on, when you have trouble understanding how a code block behaves, refer to the spec first before digging into other places like Stack Overflow.
Go Frequently Asked Questions
In Go Frequently Asked Questions, you’ll find helpful information about the design principles and how the language feels from a higher perspective. I’d recommend you read it twice: First, before you begin your Go journey, and second, after you are comfortable with Go to be dangerous at least.
Set Up Your Go Development Environment
After this initial exploration, now it’s time for Setting Up Your Go Development Environment. Once you set up your development environment, have fun playing with Go locally to explore the language a bit further, and then proceed to the following sections for a deeper dive.
Writing Canonical Go Code
The most challenging part of learning Go is maybe to feel comfortable with “the Go way”. Here, I’ll list a series of articles and resources that will help you get more comfortable with the patterns and paradigms of the language.
- How to Write Go Code demonstrates developing a simple Go package inside a module and introduces the
gotool, the standard way to fetch, build, and install Go modules, packages, and commands.
- Effective Go is a brief overview that walks you through how to write canonical Go programs.
- Go Proverbs are from Rob Pike’s talk at Gopherfest SV 2015. They might look like one-liner, zen-like suggestions, but you can write articles—even books—about each of those sayings. I’d, again, recommend you read them at least twice: First, while you are relatively new to Go, and then read them once more when you feel like you know enough Go to be dangerous at least.
- Go by Example is a collection of everyday Go-related tasks in byte-sized annotated example code pieces. It’s a must-read if you want to have a general feel of the language and become more comfortable with it.
Read the Docs
When you want to learn how a package is used and its public API, there’s no better way than reading its documentation and usage examples.
pkg.go.dev is a place where you can read the public API documentation of standard Go libraries and any other publicly available Go packages.
Dive in Further
If you have followed all of the resources outlined here so far, you should have gotten enough Go-fu to be dangerous, at least.
If you want to drill down further, here are a few essential books that I recommend: