Recent Post

Back to the Virtual Machine

Recently I was playing with Kubernetes to power my tiny blog. I am back on a Virtual Machine powered by openSUSE Leap. The trigger The xz backdoor meant that I immediately nuked the server from the Internet. While MicroOS itself uses SELinux .. the Kubernetes is known for running everything as a root by default. Leap forward Frankly speaking I am not a devops guy and Kubernetes is a hell of layers and indirections....

Lazy Neovim Configuration

I was a vim user for a while. The :wq, "+P, y, g, gg, =g and all the cryptic shortcuts invented ten years before I was born… They are just hard wired into my brain. A while ago I decided to use neovim. I was most impressed the fact that neovim turned out to be a healthy, good community project. So I did my little bit at opencollective and I contribute a few bucks monthly to the awesome neovim community back....

Iterators in Go

Go has always been a simple language from its inception. Perhaps too simple. I personally think of Go as a (successful) MVP of a programming language. With garbage collector, channels and goroutines. This simplicity is the reason why many developers, myself included, love Go. And at the same time why so many other developers hate the language. Go getting better While in core Go remain simple language, it does not prevents an evolution....

Less tracking of readers

When I moved my blog to self hosted virtual machine, I later realised that the content itself was still calling external services for web fonts and css and a javascript. It makes no sense to move from Microsoft owned Github Pages to self-hosted and force users to visit Google, unpkg.org and cdnjs.cloudflare.com every time they visit my humble blog. Self-hosted Starting from today the blog server hosts FiraSans and FiraCode fonts instead of relying on Google Fonts pure-min....

Fearless BDD for Go

I like the Go’s built-in support for testing, especially table-driven ones. At the same time I always have a problem with how to structure the test properly. It is easy to write something, but it is hard to read, adapt or improve the test in the future. Ruby developers know their RSpec, which enforces a test structure. Then there is the Given-When-Then naming convention introduced by Cucumber or Selenium tests. Let us explore the advantages and find out the simple way on how to write well structured tests in idiomatic Go....

My blog runs on Kubernetes and I like it

As I approach that famous middle age now, I realised that most of my online presence is controlled by big US companies. Pretty ironic for someone who has been using Linux and open source for decades, isn’t? So I went through a bit of a transformation process starting with deleting my Twitter account. Right after THE takeover. And joined the Fediverse at @vyskocilm@witter.cz. After Bram died I joined https://opencollective.com/neovim as a financial contributor....

Go programming language has a new version 1.21. Release Notes. Each new release contains a lot of great stuff and 1.21 is not an exception. In fact it’s pretty massive. New numbering scheme, so the 21 in 1.21.0 is a Go language version. However still under v1 compatibility promise There are many changes aroung GOTOOLCHAIN and the fact go 1.21 in go.mod has now a meaning The ability to download and use a specific toolchain version....

Turris Omnia and syncthing

The Turris Omnia router is an unusual device. Manufacturers tend to abandon their devices after a while, forcing their customers to buy shiny new hardware. The good souls behind the Omnia, the Czech domain registry CZ NIC, have a different strategy. They are constantly improving and enhancing their offering to existing customers. Syncthing integration The https://syncthing.net/ is an open source file synchronization tool. Simply speaking. It can transfer files from A to B, or from B to A, or to mirror changes between A and B....

@hintjensquotes@botsin.space: a server-less Mastodon bot

Why and how I built the simply server-less @hintjensquotes@botsin.space bot. And my tribute to Pieter. Recently I setup the Mastodon bot serving quotes of Pieter Hintjens. Pieter was one of the most influential man I ever met. And I do consider his ideas as brilliant, though-provoking, sometimes counter intuitive and typically in a sharp opposition to industry practices. His list of achievements is amazing, he was a president of Foundation for a Free Information Infrastructure fighting the software patents in Europe....

Testify: make Go testing easy 3/3

While Go comes with go test and a testing package by default, the experience can be better with testify package. Git hub page introduces it as Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend. By the end I found the resulting article as too long (~25 minutes) to read, so I split it into Part1 introduces assert, talks briefly abot Python and C and shows basics of testify Part2 introduces table driven testing, more helpers like ElementsMatch or JSONeq Part3 gets more advanced with test suited and mocks Test suites While testing documentation encourages table driven tests and subtests, there are many developers outside, who are used to write Smalltalk like unit tests and this style encourages writing test suites....

Testify: make Go testing easy 2/3

While Go comes with go test and a testing package by default, the experience can be better with testify package. Git hub page introduces it as Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend. By the end I found the resulting article as too long (~25 minutes) to read, so I split it into Part1 introduces assert, talks briefly abot Python and C and shows basics of testify Part2 introduces table driven testing, more helpers like ElementsMatch or JSONeq Part3 gets more advanced with test suited and mocks Table driven testing Table driven testing is common and usefull go idiom....

Testify: make Go testing easy 1/3

While Go comes with go test and a testing package by default, the experience can be better with testify package. Git hub page introduces it as Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend. By the end I found the resulting article as too long (~25 minutes) to read, so I split it into Part1 introduces assert, talks briefly abot Python and C and shows basics of testify Part2 introduces table driven testing, more helpers like ElementsMatch or JSONeq Part3 gets more advanced with test suited and mocks Standard approach Example as it comes with a testing package from the standard library....