jlelse's Blog

Thoughts, stories and ideas

Tags: Go


go-shutdowner: Simple graceful shutdowns in Go

Published on in πŸ‘¨β€πŸ’» Dev

As I already mentioned, I’m trying to modularize parts of GoBlog to make the code more organized and to be able to test it better (thanks to the tests, I always notice small bugs that I can then correct).

View

TIL: gob

Published on in πŸ‘¨β€πŸ’» Dev

Today I learned about gob. gob is a package from the standard library of Go and allows to store structs efficiently as a byte array. Faster than encoding data in JSON for example. Useful for communication between Go programs or for temporarily storing data. In GoBlog, I’ve recently been using gob for a SQLite-based queue for verifying webmentions and sending ActivityPub requests. gob has the same interface as the JSON package.

View

Modularizing GoBlog?

Published on in πŸ’­ Thoughts
Updated on

I just separated the function I told you about the other day (the one for marking text with β€œ==") as a Go module. This way the main code remains more organized and if I don’t need the feature any more, the module is still usable. Also for other people who might need the same functionality. I think I should modularize GoBlog even more. πŸ€”

View

"Improving large monorepo performance on GitHub"

Published on in πŸ”— Links

I always find it interesting to learn how well-known services work under the hood and what efforts are being done behind the scenes to solve performance or other productive issues.

View

How a clever organization of Go structs can save memory

Published on in πŸ‘¨β€πŸ’» Dev

Sometimes I like to take a look at the commit history of various open source projects, applications I use myself or dependencies I use in my applications. Today I was scrolling through the commit history of chi, the HTTP router I use for my blog software.

View

Generics in Go

Published on in πŸ”— Links

As someone who properly learned to program using Java and still works with Java almost every day, I am used to generics. Flexible parameters whose constraints do not yet have to be set during definition. The fact that there are no generics in Go took some getting used to.

View

Advent of Code 2020 in Go: Week 1 and Week 2

Published on in πŸ‘¨β€πŸ’» Dev

Instead of making a post every other day with all the solutions, here are my approaches for the rest of week 1 and week 2 of Advent of Code 2020.

View

Advent of Code 2020 in Go: Day 3 and 4

Published on in πŸ‘¨β€πŸ’» Dev

Here are my solutions for Day 3 and 4 of Advent of Code.

View

Advent of Code 2020 in Go: Day 1 and 2

Published on in πŸ‘¨β€πŸ’» Dev

I decided to publish my Advent of Code solutions regularly (probably every other day) here on this blog. So there are a few more posts with code to read. After all, code is a big part of my life, so it should be more present here on the blog.

View

Published on in πŸ’¬ Micro

Because ActivityPub instances can go offline from time to time and it’s general best practice to retry failed requests, I just added a new queueing system for ActivityPub requests to GoBlog using this nice library named β€œdque”. There’s always a bug or sub-optimal solution I need to fix before I want to release GoBlog (or whatever I will name it in the end) to the wide world. But the frequency of the discovery of improvable things is decreasing, so I hope I will be able to write documentation soon.

View

Next

Jan-Lukas Else