Let's Go

By chimo on (updated on )

This is a short tale about my first interactions with the Go language.

As I wrote about recently, I started using openring to display a blogroll at the bottom of my blog posts. As it turns out, it was having issues fetching one particular feed, erroring out with "expected element type <feed> but have <html>". The feed looked like valid RSS to me when fetching it with `curl`, so I suspected it might be user-agent related.

A quick look into the openring source code showed that it's using SlyMarbo/rss to fetch and parse RSS feeds. A quick search in the project's issue tracker revealed someone having the same issues as me, and a link to a different issue with a code example on how to set a custom User Agent.

I spun up a new Incus container for Go development and after a few trials and errors I managed to get something working.

I haven't spent enough time with the language to have a real opinion of it, but I think I could see myself enjoying it. Coming from PHP, JavaScript and Python, I initially found the `=` vs. `:=` concept a little confusing. The variable scoping gave me a little bit of trouble at first, but managed to get my head around both after reading a few blurbs about them here and there.

I do like how the compiler seems to be opinionated/strict for things like declared variables that aren't used and similar things to that.

All around an interesting way to spend part of an evening yesterday.