jlelse’s Blog

Thoughts, stories and ideas

Tags: Go


SQLite without Cgo

Published on in 💭 Thoughts

On Saturday morning I experimented a bit. Whenever I used SQLite in a Go application, I used the popular package mattn/go-sqlite3. Not a bad choice, after all it implements the database/sql interface. One drawback, however, is the need for a C compiler, since Cgo is used to run the original SQLite code in the background.

View

“Darker Corners of Go”

Published on in 🔗 Links

Another entry from my reading list: “Darker Corners of Go”. Rytis Bieliunas has taken the effort to write down all the points to consider when programming with Go. A lengthy list, even if I personally find Go simpler than, say, Java.

View

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

Next

Jan-Lukas Else