learning golang

Alex Leonhardt
{ ovni }
Published in
3 min readAug 2, 2017

Ever since I started to dabble into Golang, I immediately liked it. It’s not because of the current hype and it’s a “cool” new language to learn, but because it is lower level than many languages, yet surprisingly “easy” to start with.

I have some Python background, mostly writing tiny applications and scripts for automation, Ansible modules, small apps like Sensu Grid. As you can see, nothing major and all of these are performing well enough for what they are designed, but they all lack one important thing that comes with Golang “for free”.

One binary to deploy. That’s it. Nothing more, nothing less. Just one file, once on the box/container, it runs.

Ok, actually two things, the 2nd best thing about Golang is how easy it makes it to write code that can execute concurrently. It’s a nightmare (almost) with Python and I’m sure other languages too. I find it being a breeze with Golang. Once you get your head around channels, and how to use them with Go routines, you’re all set.

What I did to learn Golang

First of all, a good foundation is important, whether that is in Go or any other programming language, some time ago I completed a course “Introduction to Computer Science and Programming” via EDX, MITx is one of the founders and they are actually using Python to teach the very basics of problem solving.

But what about Golang!!!? Well, as I mentioned, it’s important to have a good foundation, and that course, if you’re not already a Software Developer, will give you the best there is, in my opinion anyway.

So there it is, I then found myself a Golang course, the idea was to actually try and get a curriculum as close as possible to that of the Python course, for me it’s easier to learn programming languages when I can directly compare things, e.g. “this is how you do it in python” and “this is how you do it in Golang”.

I would say one of the best Golang courses out there, not just due to the material, but also because of the teacher, Todd McLeod, is Learn How To Code at Udemy. It’s great to have the teacher’s enthusiasm “virtually” jump over and make you want to understand “why” and keeps you on learning and finishing the course.

Online courses

Most courses these days are self-paced, the issue with them, to me, is that if you lack discipline or the course isn’t made interesting / engaging enough, you are very unlikely to finish the course, even though you really want to learn “this thing”.

I very much prefer the way EDX/MITx did the Comp Science course, it’s not self-paced, you have to have done your “Homework” and you have to have done (and pass!) the exams to receive a certificate. I believe it makes one feel more accomplished this way.

What I have done with Golang so far

So far, still have only been dabbling along, but the plan is to continue to learn Golang and start another course focusing on Web programming with all the goodies, and hopefully make me a little more “testing” focused than I am currently.

Apps I have done so far are

  • Auditr - a small program to read audit.log to verify incoming/outgoing connections to/from a Linux server (i.e. you saw some suspicious traffic and want to know where that is going, what port, which app does it, etc.)
  • AWS CloudWatch alarm to Prometheus AlertManager agent — ships off AWS CW alarms from a SQS to Prometheus AlertManager where it’s easier to route alarms and also dedupe, etc.

Next up

The course I will be jumping on next is Web Development with Golang, also from Todd McLeod. I liked the last one, so I’ll give this a Go (pun intended).

There are many many other resources on Golang on the vast Internet, and it’s not always easy to find good ones. I will try and collate a list of resources I currently use that help me understand and learn Golang and update this post with those.

Links

--

--