How to Test Code that Executes Subprocesses

I was writing some stuff that programmatically executed terraform via Hashicorp's terraform-exec library this week. This works by interacting with a terraform executable that you provide (along with a working directory) to the NewTerraform constructor. Here's the trick: when testing this code it does not need to interact with the real executable. It can subprocess… Continue reading How to Test Code that Executes Subprocesses

Dependency Inversion with Client Side Interfaces in Go

One interesting thing about Go is that it lacks and explicit implements keyword for interfaces. If you want to implement an interface, there's no extra step. As long as function signatures match the interface, or function type declaration in those cases, the interface is implemented. The same could be said of Python protocols too. Coming… Continue reading Dependency Inversion with Client Side Interfaces in Go

Posted in Go