Blog Posts

todocheck v0.2.0 is live!

todocheck logo

The next release of todocheck - the tool that helps you track & keep TODOs actionable is live!

First time you hear about it? - check this out first.

In version 0.2.0, the main focus was extending support to new programming languages & issue trackers.

Hence, there are now five new languages supported - R, PHP, Rust, Swift & Groovy.

Support has been also provided for two new issue trackers - Pivotal Tracker & Redmine.

Additionally, one useful new feature is that todocheck now supports passing in your issue tracker authentication token via an environment variable - this will make it a lot easier to integrate the tool in your CI environment!

Finally, you can now specify todocheck's output to be in JSON format. This provides the opportunity to create IDE plugins or include support for todocheck into linter aggregators.

See the full changelog here & don't forget to update your binary to the latest release!

Eliminate the undocumented TODOs with todocheck

todocheck logo

Yesterday, I released todocheck - a new kind of static code analyser for annotated TODOs.

Way too often, we let leftover TODOs slip into our main branch, which leaves your coworkers puzzles, looking at it a year from now.

They're thinking - what did I mean by "TODO: Move this to the users package"? What is the users package? It doesn't seem to exist anymore.

todocheck helps you fix this by forcing you to mark all your TODOs against an existing, open issue in your issue tracker.

That way, if you, at some point, close the issue, thinking you're done, the CI pipeline will sparkle in red as there is an open, unaddressed TODO in your main branch.

No longer can developers close a half-baked issue, rushing for the weekly sprint review to say "I'm done!".

Continue Reading

A Concise Guide to the Latest Go Generics Draft Design

Generics in Go

Recently, the Go team announced an updated draft design for their Generics in Go proposal. It goes into a lot of details about why certain decisions were made, implementation details, etc.

In this article, my goal is to summarise the major upcoming changes, as the whole draft design can be a mouthful for many.

I will provide some code snippets to demonstrate the major features as well as give you the chance to experiment yourself with them, thanks to the new Go playground with support for generics.

Continue Reading

How to Use Structured Logs in your Go Application

structured logs in Kibana


This article is part of the series Integrating your Go service with ELK

The Elastic stack (also referred to as ELK) can bring a lot of value to your production services. But it is not that much of value if you don't use structured logs in your services.

In one of my latest posts, I wrote about what ELK is and why you should care. I also wrote a tutorial about how to integrate ELK with your Go app.

In this article, I will walk you through how to integrate structured logging in your Go services. We will use a sample HTTP service with a few basic endpoints and we'll use the zap library to emit logs on error/success, which would also include some domain-specific info.

Continue Reading

How to integrate your Go Service with ELK

Go loves ELK


This article is part of the series Integrating your Go service with ELK

In my last post, I shared how much value the ELK stack could bring for your application in terms of the monitoring capabilities it gives you.

In this post, I will walk you through how to integrate your Go application with ELK, what are the different parts of ELK, how they work and how to create a basic configuration for them.

Let's jump straight in, shall we?

Continue Reading

Getting The Most Out of Your Logs with ELK

Analysing Logs with ELK


This article is part of the series Integrating your Go service with ELK

When you start developing your application, you typically instrument it with some logging to be able to debug problems later.

Some skip it in the development phase, but once the application hits production, then it is crucial to have some logging.

After all, once users complain that something isn't working, how would you be able to find the root-cause?

And although logging proves to be useful, many companies don't really capitalise on its potential as they're still clinging to the classic way of writing freestyle logs and grep-ing them on their prod machines afterwards.

However, there is so much more potential that logging holds for monitoring our production systems. In this article, I will show you how to get the maximum value from your logs using the ELK stack.

Continue Reading

Managing Shared Components in Go Microservices with Fx

Managing Shared Components in Go Microservices


This article is part of the series Dependency Injection in Go using Fx

In many companies nowadays, microservices is the de facto way of handling service architecture. Some do it out of necessity as their application has reached a scale where the monolith is a bottleneck. Others, simply like being onboard the hype train. Whatever the scenario, the decision is often backed by the classical case for adopting microservices, which every junior dev studies extensively before their system design interview. What gets often neglected, however, is the problems which come with such an approach. Each of these problems usually demands a sophisticated solution, which raises system complexity. One such problem is how to reuse the shared infrastructure components in your microservices. Each of your services will probably have a distinct business logic, but it will also come with a big baggage of infrastructure code. These components usually don't change too much between your services - healthchecks, monitoring configs, logging, standard service configurations, etc. Fortunately, there is a very elegant solution for this problem for your Go services, which utilises the Fx Framework. It helps you by automatically managing your dependencies, but it can do much more than that as I'll show you in the upcoming sections. In this article, I will show you how to effectively extract your components into reusable & independent modules which can easily be shared across your Go services.
Continue Reading

Dependency Injection in Go using Fx

Dependency Injection in Go


This article is part of the series Dependency Injection in Go using Fx

When you initially start a Go project, your main function typically has a bunch of wiring code - initialising your routes, plugging in middlewares, initialising your template engines, loggers, etc.

This is one of the great things about Go - you don't have any magic happening behind the scenes. The code is all there and you can read it and debug it.

But as your software grows, you start feeling the growing pains - your main function starts becoming more and more convoluted. You start having all sorts of small bits and pieces plugged in here and there - healthchecks, database setup code, metrics, tracers, external API connections, etc etc.

And what if your application grows into a microservice architecture? What do you do when you have five different microservices demanding the same bunch of setup code, specific to your environment?

In this article, I will introduce you to Fx. It's a Go framework which solves both problems outlined above using dependency injection.

Let's jump in.

All the code from this article is available in this repo.

Continue Reading

Automate Your Initial OS Setup

Automate your OS Install Process

There was a time in my life when a huge part of my time was spent reinstalling my Linux OS. Wonder why?

Well, the first time you install Linux, they warn you to never run rm- rf / as this would delete your entire system. Fair enough, that's simple to follow.

What they don't tell you is that you have another million ways to effectively do the same thing with commands which seem harmless at first glance.

However, there were some benefit form my misfortunes.

What irritated me the most was installing all the software I use from scratch every single time. I often forgot to install one or two programs I use and had to do it on the fly once I actually needed them which was very disturbing.

Hence, I came up with the idea to create a script which would automate this process via a single command. Every time I reinstall my OS, I simply run the script, go get myself a coffee and once I'm back, I have my OS all setup with what I need.

If you're in a situation where you often have to do this yourself, read on.

Also, be aware that this guide is specific to installing Linux and Mac OS. You could probably apply the same concept in Windows, but I only speak bash, not bat.

Continue Reading

My Experience with Learning Golang

golang-experiment

So you want to learn Golang?

Great! Perhaps I could help you. When I learnt I'd be joining Uber, I had some time to prepare for the tech stack ahead. One of the key things I had to get onboarded to quickly was coding in Golang.

So I started searching for good courses around the web, which could help with getting me caught up with the language and its paradigms. Some were great, others were pretty bad. And the bad part is, it isn't obvious at first glance.

Actually, some of the most promoted courses on Golang are some of the most useless ones. So learning Go can be quite frustrating due to the lack of good courses out there.

In this article, I will share what good, bad and ugly courses I've encountered in the bumpy ride of learning Go.

Continue Reading

Site Footer

BulgariaEnglish