The log package in Golang

Logging is essential when creating large software that has a complicated flow of execution. In multiple stages of execution, it allows us to debug the program for errors. In this post, we are going to explore the Golang log package and what can we do with it. Importing Golang log Package To use logging in […]

The log package in Golang Read More »

The fmt package in Golang

In multiple stages of a program, we need to print values or other data or we may need to log various data for debugging. This type of basic debugging helps us write better code. The fmt package supports various format specifiers for printing. In this post, we are going to discuss the fmt package in

The fmt package in Golang Read More »

Golang Sort Package

Sorting is an essential operation for many algorithms. Go provides sorting functions for many different data types. In this post, we will discuss about Golang sort package, which is used to sort elements in an array, list, slice, etc. Importing Golang sort Package To sort data types in Go we need to import the sort

Golang Sort Package Read More »

The init function in Golang

The init function is a powerful function in Go. It allows doing things like initialization of a package that otherwise really hard to achieve. In this post, we are going to take a look at Go’s init function. What is the init function in Golang? The init function is a function that takes no argument

The init function in Golang Read More »

Methods in Golang

Methods are just like functions, except it has a special argument and that is a receiver. In this post, we will dive deeper into Golang methods. Golang Methods Syntax A method consists of the func keyword, the receiver argument, and the function body. Here is the syntax of a Go method. So, when we want

Methods in Golang Read More »

The if-else expression in Golang

The if-statement is present in almost every programming language out there. It is one of the most important control-flow statements in programming. In this post, we will explore the different ways we can use the if statement to make our programs robust and concise. 1. The syntax of if-expression in GoLand The syntax of the

The if-else expression in Golang Read More »