GoLang pointers makes it easy for us to mock objects!

Photo by Ferenc Almasi on Unsplash

Writing unit test has always been confusing especially when we have multiple libraries and framework integrated in our app. Follow along as we write up our initial project and test template so you can start your project at ease!

The Structure

One of the most important aspect in any project is our folder structure. GoLang can compile multiple files within a directory into a package, when we import a packge, it will import the entire directory. Since we are going to build a REST API, we can follow a basic structure Model-Controller and structure our folders as such:

Photo by Dominik Lückmann on Unsplash

Recently I had the opportunity to build a CI pipeline for various microservices using GitLab. The issue comes when it’s time to run the unit test, as some of the projects does not use a mocker and would want to connect to a test DB. Thankfully there is a way for us to generate a temporary database for testing purposes.

In this scenario, I will be using GitLab dindDocker-In-Docker (dind) to build, test and deploy the image.

Let’s start with an example Dockerfile, for this I will assume we are using a simple NodeJs project

An age-old concept rebranded for the modern world.

Photo by Ismael Paramo on Unsplash

I want to preface this by stating that the goal of this write-up is not to force some type of indoctrination — instead, I want to have an open conversation on the correlations that may exist between the actions/advice we have been getting in the modern world on mindfulness against an age-old concept that is still followed by millions of people; the power of prayer.

Mariam-Webster defines praying as a way to address a god with adoration, confession, supplication, or thanksgiving. Similarly, in the modern world, we may substitute praying with either meditation or journaling. …

How starting over is not a bad thing

Photo by Greta Schölderle Møller on Unsplash

This year I lost almost everything that I owned. Twice.

This year I have migrated to 3 different countries, intending to live in the first two to be longer. As the world plunged into uncertainty, I decided the best place right now is to be where my family is. However, my departure from the other countries was not clean as I have left many things. Now I am faced with a decision on what to do with them.

On one, I was trying to fit all that I have into two 25kg boxes so that it can be ready for…

Why it is Important to be Intentional

Photo by Celina Albertz on Unsplash

Today I had banana bread for breakfast. The same one that I’ve been eating, but what’s different today was that I was just eating my banana bread and nothing else. No YouTube or Netflix to watch, no scrolling through Instagram — it was my breakfast and me.

When was the last time you ever did just one thing?

Try to have a walk down the park without any music, to have a meal without anything to watch, or just doing your work without the TV making background noises. We may have reached a point in our life where we are…

Photo by sarandy westfall on Unsplash

Like many, the pandemic has put a lot of our life on hold. There are those who sees the pandemic as just a nuisance, while many are faced with a difficult task of figuring out how to survive tomorrow. Regardless of which position we see our self in, many are probably shuffling through their phones right now — trying to remember a better day.

I have been on a quest to a pseudo-minimalism lifestyle, taking things out of my life both physically

and digitally

However, there was one area where it took me the longest (and hardest) time to clean…

Knowledge is power.

Photo by Ben White on Unsplash

The internet age has allowed us to access information with just a click of a button. From entertaining to informative, with just 5-minutes on the web, you will definitely find what you are looking for. Best of all, THEY ARE FREE.

While my title suggest that we should read more books, I am arguing that we should move through properly published material rather than the ones that are easily accessible — even if it means that we have to pay for it.

Where things take a turn

The internet has given everybody an amazing opportunity to share their ideas, and maybe make…

Why it’s important to clean up your digital lifestyle

Photo by NeONBRAND on Unsplash

As we extend our footprint from physical to the digital world, how many of us have glanced back at our devices and checked out what’s stored in there? Our computer folders riddled with documents that we most likely forgot exist; folders filled with photos, videos, and files that probably will never see the light of day. We try to simplify our life by downloading apps, yet a 2019 research study suggests that we spend about 96% of our time with just ten apps (source).

With apps and files not taking any physical space, it’s easy to ignore the problem.


Smarter watches does not mean smarter lifestyle

Photo by Hermes Rivera on Unsplash

They say time is the greatest invention of mankind — we defined our daily life towards it. It dictates when we wake up, when to eat, go to work and finally to sleep; so it’s natural for us to create a piece of tech that would help us keep track of our time.

We strap on our favorite wrist watch, and let it tell us where we are in time.

What made the wrist watch functional was its ability to tell time just by the flick of the wrist. I am an advocate of wrist watches, I wear them for…

How owning less can solve a bigger problem

Photo by Jacek Dylag on Unsplash

Contrary to what we occasionally read online, we DO NOT need the top 10 things to make our kitchen better. In fact, most of the time we don’t need much of anything. However, we all got hit by that problem before; “I can’t do A if I don’t own B” or “I’ll start doing A once I buy B”. With the convenience of online shopping and overnight shipping —we won’t even realize it’s a problem until it’s time to pack up and leave.

You will always want more

When we buy things as an excuse, then another excuse will come by and say that it…

Nabil Sutjipto

Digitizing Indonesias healthcare one microservice at a time. Currently engineering my life with real life lessons.

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