Suggestions for learning golang

I’ve had some fantastic support from these forums the past couple of months but I want to learn more about golang and specifically golang templates so that I don’t have to keep asking numpty newbie questions.

Does anyone have any recommended learning resources? I was looking at Learn How To Code: Google’s Go (golang) Programming Language on Udemy but not sure how useful it would be.

many thanks, Jake

1 Like

I think Go is a great language to learn and work in, but…

I don’t think you need to study Go for this. If you want to take up learning Go as a hobby and can use it for other tasks as well, go for it. :slight_smile:

But templating is just a small subset in Go, and it feels inefficient to me to learn the Go programming language just for that. Furthermore, most Go programming courses that I came across don’t deal with templating because it’s a small subset of possible things you can do with Go.

To put it into perspective, Donovan & Kernighan’s Go programming book (The Go Programming Language.) spends 5 pages talking about the text/template and html/template packages (which do the templating you talk about here). The other 360 pages are about other Go features.

If you just want to know more about how templating goes with Go, reading blog articles like these will get you there:

And of course the text/template and html/template documentation.

I don’t see you making numpty newbie questions. But even if you did, that’s no problem. Here’s a secret; even Bep was a big Hugo newbie once. :wink:


Thanks so much for the comprehensive answer, those templating links will save me a lot of time :slightly_smiling_face:. I would like to learn more about Go but at the moment, I have to concentrate on designing and building websites for clients, which is one of the reasons I’m getting on so well with Hugo.

I like to think I have a pretty good grasp with Hugo templating, and I would highly recommend the route I took:

  • Udacity Intro to Programming Course - This will teach you about programming logic etc. It uses Python, but the concepts help with any language.
  • TeamTreehouse do a 2 hour course that looks at Go Syntax. You need to know a programming language already as it doesn’t teach concepts, but it helped me understand quite a bit and apply my Python knowledge to Go Templates.

Then just start building stuff, and learn as you go. Pick apart examples on the forum \ hugo docs. I remember a lot of trial and error type coding when I first started, but slowly and surely, everything started to click.

Anyway, that is the route I took, and it worked well. Probably not the most efficient way though, as I didn’t know about Hugo until after I learnt python.

1 Like

One suggestion would be to look at other people’s work.

One recent example would be this new theme:

Really nice looking, but also very clean and elegant on the template/config side of it. Well documented/commented.


thank you, good to know other people’s approaches :slightly_smiling_face: Also gives me some hope!

Darned fine idea, thank you. Will disassemble theme later :slightly_smiling_face:

Actually when I first started building a website, I took someones theme and tried to adapt it to my purposes. I could see the layout and how to approach templating. After a few days of adapting the theme I then decided to build my own website from scratch, but taking code snippets from the theme \ hugo docs. Looking at existing theme when starting really does help, and how I first started building a site with Hugo.

1 Like