Golang

The Go Programming Tutorials

Packages in Golang

Packages allow us to focus on the code reuse principle aka the DRY (Don’t Repeat Yourself) principle. It enables us to write concise code in a structured manner. In this post, we are going to take a look at the package system in Go. What is a package in Go? A package is essentially a […]

Packages in Golang Read More »

Pointer to a function in Golang

Go has no apparent “pointer to a function” but it can store the functions and call it later making the function pointers implicitly defined. What is a function pointer? In some programming languages like C/C++, there can be a pointer that can store the address of a function and later call it using itself. This

Pointer to a function in Golang Read More »

Pointer to a struct in Golang

Pointers are a useful entity that stores a memory address in it. Structs are the building blocks of data structures in Go. In this post, we are going to explore pointers to a struct in Golang. Pointer to a Struct Syntax The syntax of a pointer to a struct is just like any other pointer.

Pointer to a struct in Golang Read More »

The list container in Go

Lists are an important aspect of programming. It is one of the most important data structures used today. In this post, we are going to explore about lists in Go. The “container/list” package To use lists in Go, we import the list package inside the container package. Then we can use the lists in Go

The list container in Go Read More »

Import in Golang

Almost everything we want to do in Go comes from some package. And to use those packages, we need to import them. In this post, we will explore different import methods available in Go. Types of imports in Go Go has different kinds of imports that are used for different cases. Here are the import

Import in Golang Read More »

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 »