a tumblelog
Thu 05 Dec 2019

Simple Go Mocks

Go‘s interfaces and “duck typing” makes it very easy to create simple mock or stub implementations of a dependency for testing. This has not dissuaded a number of people from writing generalized mocking libraries such as gomock and testify/mock, among others.

Here I want to describe a simple alternative pattern I frequently use when writing tests for an interface, that I think is generally applicable to many use cases.

Source: Simple Go Mocks, an article by Jonathan Hall.

Set up tab completion for ssh and scp

Tab completion is a ubiqutious time-saver, and I use it everywhere I can. Here’s how I set it up to autocomplete hostnames when I use the ssh or scp commands.

Source: Set up tab completion for ssh and scp, an article by Andy Lester.