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.

Recent articles from blogs I follow

I think fedizens should be able to disable replies to some or all of their posts

Every so often, there is a bit of a debate in the fediverse about whether a person should be able to make a post to which other users cannot reply. Yes, they should My view is simple: yes, they should. It is no different to running a website and not offering…

via Neil's blog December 7, 2024

Adding Encrypted Swap and a Userspace OOM-Killer

When setting up my Ideapad, I didn't configure swap because I wanted to avoid reducing the (already unknown) lifetime of it's eMMC storage. This, however, has proven to be a mistake - the Ideapad only has 4GB of RAM and I'm quite good at accid…

via www.bentasker.co.uk December 7, 2024

Advent of Code: Day 4

Link to Day #4 puzzle.

via not just serendipity December 6, 2024