Golang


Learning Golang - templates

When I started learning about Golang templates much of what I read was around their syntax and feature set. It didn’t take long, but I found myself struggling to do things that struck me as being pretty basic. So I figured I’d write down a few things I’ve learned. By no means is this intended to be a proper (or even correct) howto on Golang templates, rather it’s just what I’ve learned so far.

Switching to Hugo

Long ago I had a website written in Cold Fusion, ASP, PHP, Python. I wrote a simple blogging feature and created content via a rich text editor. This was grand, but eventually I lost interest in “building a website”, but I still enjoyed writing stuff. I like writing stuff because it’s fun and it relaxes me. So I migrated my site to a static site using Tinkerer. I chose that tool because I was am a big fan of restructured text a tool called Sphinx.

Learning Golang - simple scripting

Today I decided to perform a simple scripting task in Golang. One of the challenging aspects of coding with AWS is testing code locally. In AWS we usually use instance credentials for anything that requires permissions to AWS resources. This happens automagically via the AWS sdk when you run code within AWS. The trouble is that when you try to test the same code locally, it doesn’t have access to these instance roles - so you need to handle that.