Using context.Context with cobra

Even if creating CLI applications is straighforward with Go, there are many libraries to help with that task, specially to handle subcommands and flags. Cobra is likely one of the more popular ones. It’s relatively simple to use and it’s easy to get something working...

Use internal packages to reduce your public API surface

In the beginning, before the go tool, before Go 1.0, the Go distribution stored the standard library in a subdirectory called pkg/ and the commands which built upon it in cmd/. This wasn’t so much a deliberate taxonomy but a by product of the original make based build syste...

1º Open Source Joinville Meetup

Shared some tips about managing medium-sized OpenSource projects. The slides are in Portuguese.

Integration Testing in Go: Part II - Set-up and Writing Tests

Prelude This post is the 2nd installment of a 2 part series about integration testing. You can read the first installment, which is about executing tests in a restricted environment using Docker. The example repository that this post draws it examples from can be found here. Intr...

Be wary of functions which take several parameters of the same type

APIs should be easy to use and hard to misuse. — Josh Bloch A good example of a simple looking, but hard to use correctly, API is one which takes two or more parameters of the same type. Let’s compare two function signatures: What’s the difference between these functions? O...

go.mod's go directive

Recently I ran into a curious behavior related to the go directive in the go.mod file. It’s well documented, but it’s nevertheless surprising. Go 1.11 introduced support for modules, as a way to define a collection of related Go packages. You can find details about it...

The Golang News mobile app

tl;dr I wrote a Golang news aggregator mobile app, I open sourced it. If you use Android, you can get the app. It is no secret that I am a huge fan of the Go language! Go has proved to be a very reliable partner in my projects, whether the project in question is personal or prof...

Don’t force allocations on the callers of your API

This is a post about performance. Most of the time when worrying about the performance of a piece of code the overwhelming advice should be (with apologies to Brendan Gregg) don’t worry about it, yet. However there is one area where I counsel developers to think about the p...

Google Home Action to manage your Kubernetes cluster

I always wanted to find a good use case of Google Home to make some DevOps tasks funnier. For example voice deployments, system metrics, etc. Since I use Kubernetes a lot, I thought it would be fun to control it via voice commands.

Why is DevOps Important?

1. What are four keys for great DevOps? Collaboration: DevOps requires collaboration, both within teams and between teams. Good communication between teams implies to break down silos, which can be harder than it sounds in organizations where a leader and their team are rewarded...