golang.pngGolang : Check if an integer is negative or positive

19th March 2018

A simple example on how to check if a given number is negative or positive number in Golang.

Here you….... read more

golang.pngGolang : Count number of digits from given integer value

16th March 2018

Just a simple program to count number of digits from a given integer value. Need this to calculate if an….... read more

golang.pngGolang : Extract part of string with regular expression

11th March 2018

Below is a simple example of how to extract a specific part of a string with the help of regular….... read more

golang.pngGolang : Parse date string and convert to dd-mm-yyyy format

11th March 2018

A reader enquired on how to use Golang to convert date string such as "28th nov 2016" or "nov….... read more

golang.pngGolang : Randomize letters from a string example

11th October 2017

For this short tutorial, we will learn how to randomize the letters(including symbols and empty spaces) in a string. Such….... read more

golang.pngGolang : Convert int to byte array([]byte)

30th September 2017

Problem :

You need to convert integer variable or constant to byte array ( [] byte ). How to do….... read more

golang.pngGolang : Test if an input is an Armstrong number example

26th September 2017

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is….... read more

golang.pngGolang : Lock executable to a specific machine with unique hash of the machine

21st September 2017


Got a friend that was looking for ways to lock her Golang executable to a specific machine at her….... read more

golang.pngGolang : Capture text return from exec function example

20th September 2017


You want to capture the text result return by exec function. How to do that?


The code….... read more

golang.pngGolang : Test a slice of integers for odd and even numbers

20th September 2017

Got this question from one of my students and he is from a disadvantaged background(he is a refugee). He wanted….... read more

golang.pngGolang : Execute terminal command to remote machine example

6th September 2017


You need to query a remote machine with ssh to extract information such as memory usage or CPU information.….... read more

golang.pngGolang : Verify Linux user password again before executing a program example

4th September 2017

One of my previous tutorial shows you how to restrict a program execution to root only and this can….... read more

golang.pngGolang : Check a web page existence with HEAD request example

30th August 2017

There are times when we need to check if a web server is up and running first before querying further….... read more

golang.pngGolang : Submit web forms without browser by http.PostForm example

30th August 2017

Writing this tutorial on how to submit a web form without using a browser. We submit web forms almost every….... read more

golang.pngGolang : Print instead of building pyramids

29th August 2017

Building a pyramid using ancient Egyptians way can be too difficult for more software developers. Just for fun, let's print….... read more

golang.pngGolang : Calculate percentage change of two values

28th August 2017

Here is a simple example on how to calculate the percentage change from two numbers. If the result is positive….... read more

cloudflare.jpgCloudFlare : Another way to get visitor's real IP address

27th August 2017


Your web server's log such as NGINX's access.log is showing unusually high and intense query from a couple of….... read more

golang.pngGolang : Join lines with certain suffix symbol example

23rd August 2017

For this tutorial,we will learn how to join lines of text into a string and also explore the option to….... read more