vblinden.

software engineer – @github

Let's (learn) go

I find that writing blogs is hard. This is because English is not my main language (I still don't know exactly what the difference between to and too is or when to use a or an) and I never could think of a interesting topic to talk about. I wanted to learn the programming language Go (also known as golang) and thought it was a cool idea to blog about my journey learning it.

They say the best way to learn a new programming language is to build something. So I started building a blogging application in Go, which you are viewing right now. All the code is open-source and can be found on my GitHub page.

I had the choice to use a framework (with routing, validation, an ORM, etc.) or code it all myself. I choose to code it all myself. Building everything yourself is perhaps harder to do and takes longer to accomplish, but you will learn the in and outs of the language.

As my main text editor I will be using Visual Studio Code, which comes with an awesome Go package which is made by Microsoft. The extension will install all the Go related tooling you will need (like go-fmt) When I got my workspace setup it was time to figure out how to build a blog. The first thing I had to figure out was which webserver to use, luckily this was very easy because Go has an offical package named net/http. With the webserver part handled, I needed routing. A quick search on the internet for a good Go routing package and I found gorilla/mux which will handle all of my simple routes. The only thing left to do was templating, but Go has that covered too with the offical http/template package.

Go is really a great language which makes great use of packages to add extra functionality. The only limit of this very simple blog is it can only show a maximum of one blog post. In my next blog we will talk about how to fix this.

Thanks for joining me on this journey and Let's "Go"!