How to Learn Go

3 min read Original article ↗

Over the past few weeks, I’ve picked up Go. I think it’s safe to say that I have an unheathly infatuation with it.

In any case, some background on Go:

I could describe how and why it’s awesome but many have already done so. Plus, I might still write my own post about it.

Trying to learn a new language is usually kind of confusing because you’re not really sure where to start so here’s my list of resources that helped me learn and deploy a production app in less than a week:

  • Tour of Go — we lucked out this time. The offical Go website has a great interactive resource to walk you through the syntax and different constructs in the language. This is a must – it helps you get to the core of the language without having to futz with installation, PATHs and whatnot. PS: Solutions for exercises here
  • How to Write Go Code — what? Another amazing resource from the official site? It’s true. After finishing “Tour of Go”, you’ll be foaming at the mouth to write some code on your own computer. This walks you through exactly that. Go has a certain directory structure it expects so be sure to read this one.
  • Effective Go — Seriously, I’ve never seen a official programming language website have as many good reading material as Go does. This is more of a idiom / convention reference. I tend to come back to this page when I want to know the what idiomatic Go code should look like.
  • Concurrency is not Parallelism (video) — while not technically about Go, this video (presented by Rob Pike, one of the languages creators) is really important in really defining what concurrent programming is, and how one should break down a large problem into smaller, concurrent ones. Since goroutines are really cheap to create, you are encouraged to create a lot of them — and the only way to take advantage of this is to have many small concurrent parts to your code. Slides here.
  • Go Concurrency Patterns (video) — another presentation by Rob Pike. Now that you had your mind stretched with the last video, this one will show you a few ways to use the Go concurrency features and how you can achieve things like synchronization without locks and such.
  • Go by Example — much like “Tour of Go”, except not interactive.

Happy hacking!