Having good logging is crucial for running and debugging applications in production. It reduces your issue to resolution time by providing details about every action, request, and response. Designing a good logging system isn’t a trivial task, and requires an eye for detail. Here’s how I do it in Go!

No matter the language you used, you were probably logging things to ease your debugging. Printing to stdout works on your local machine, but as soon as you have to deploy it becomes harder to deal with, especially if you need to scale and run your application across multiple servers.


A few months ago I started working on a project that heavily relies on RabbitMQ as a message broker. We have two clients communicating with Go, one via AMQP (RabbitMQ) and the other through HTTP. As our dependency on RabbitMQ is big, I had to write a robust client that does graceful shutdowns, panic recoveries, is multithreaded, logs everything nicely, and more.

10th October 2020: Fixed reconnection logic in example

Modern cloud applications tend to be decoupled into smaller, independent services (microservice) that, compared to classic/monolith applications, are easier to develop, deploy, and maintains. Message queues provide communication and coordination…


One of the greatest things about Go is how it deals with concurrency. It is far simpler compared to other languages. It uses so-called goroutines - a lightweight thread managed by the Go runtime. While they are mostly used for asynchronous, fire-and-forget stuff (most common usage being HTTP multiplexers), I recently needed to have them updated post creation. The obvious first choice in Go would be to use channels, but trying to build the solution with them caused me some issues, which made me opt for a far simpler one - maps.

I have a client that runs a food-ordering…


I’ve started working with Go in early 2017, and since then most of my work has been writing RESTful APIs with it. With time I gained experience. and I constantly change the way I write APIs in Go. After a year of working with Go, I’ve released Gorsk — a Golang RESTful starter kit, and an update to it 6 months later. I get many emails and questions on how to use it properly, which means that something like Gorsk is highly needed. …


Go’s standard library contains a single date package — time. The type provided by it, Time, contains date, time and location information. More often than not we don’t need location info, or we need to represent date/time only. dt provides exactly that, a time-zone-independent representation of time that follows the rules of the proleptic Gregorian calendar with exactly 24-hour days, 60-minute hours, and 60-second minutes.

Repo available at: https://github.com/ribice/dt

Most, if not all of the applications being built require some info about time. Whether it’s timestamp of object creation/update, user’s birthdate or some schedules.

Go’s time package represents a unique…


Building a live-chat server is a good practice for learning a ‘backend’ programming language. You need to provide an uninterrupted stream of data (think WebSockets), message storer and ideally a pubsub mechanism to send a message to all subscribed consumers. Goch is no different, besides HTTP and REST endpoint it uses WebSockets, Redis, and NATS-streaming to support live-chat messaging. Read how it runs and how you can build your own live-chat in Go.

Besides a learning project, a live-chat server can be useful for many things. For instance, we use it for support chat in our automotive SaaS. There are…


We’re happy to announce that today we’re releasing Confello to the public. Confello is a tech conference aggregator website that lets you view, search and discuss tech conferences around the globe.

Few months ago we had plans to find and attend a tech conference somewhere in our region. We tried searching online, but couldn’t find a suitable website that contains a comprehensive list of tech events and is easily searchable so we can find events covering topics we find interesting.

As huge fans of tech conferences we decided it might be good to make such a website. …


Refactoring source code should be a constant process in software’s lifecycle. I advocate for 20–25% of time spent on developing software to be used on refactoring exclusively. After working with Gorsk in two projects running now in production (one of them being a large SaaS), I’ve found many things I don’t like about it. During the development of those projects I refactored some things, but I decided the base needs to be updated too.

According to Wikipedia, Refactoring is the process of restructuring existing computer code without changing its external behavior. Refactoring improves nonfunctional attributes of the software. Advantages include…


I’ve been dealing with RESTful services for the last three years, both professionally and for hobby projects. Since I came from SOAP/XML/Oracle background, REST felt so great and modern. Even though I felt late to the party, I think I didn’t lose that much. However, with the advancement of Cloud Native projects, I feel like I’m getting behind modern tools and technologies. And I want to change that.

I started my professional software development career building solutions for the telecommunication sector using XML Technologies (XML, XQuery, XPath, XSLT) and Oracle ones (puke). I’ve dealt with that for two and a…


Twisk, an acronym for Twirp starter kit, helps you get started with a simple Golang RPC framework with protobuf service definitions — Twirp. It features everything from authorization, implemented CRUD on a single entity, logging, configuration and more. Using minimal dependencies, idiomatic code and best practices, it helps you get started with Golang backend API development — both JSON and Protobuf.

About four to five months ago our company adopted Twirp for building some of our APIs with it. Since there are barely any blog posts and tutorials mentioning it, I decided to give a lightning talk on how we…

Emir Ribic

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store