Golang

The Go Programming Tutorials

The test functions in Golang

In this post, we will discuss some ways we can create test functions in Go. Test functions are essential but it not always obvious how we can run tests in a better and efficient way. Writing the same code over and over again can take a huge amount of time. This post aims to provide […]

The test functions in Golang Read More »

Tar and gzip in Golang

In this post, we are going to take a look at how to tar and untar files and how to zip and unzip using gzip in Golang. What is tarring and gzipping? The tar is an archive which joins all the file together into a tar file. It is an archiving algorithm. The gzip function,

Tar and gzip in Golang Read More »

Profiling in Golang

Profiling is an important task that cannot be avoided for larger applications. Profiling helps us understand CPU and memory intensive code and helps us write better code for optimization. In this post, we are going to take a look at the pprof package which helps us do the profiling in Go. What is profiling? Profiling

Profiling in Golang Read More »

Logging in Go using logrus package

Logging is an important task that needs to be done properly when creating large software. It is almost essential in enterprise-level software creation. In this post, we will discuss the logrus package. It’s an external logger package for Golang. Installing logrus To install logrus we need to run this command from the terminal: This command

Logging in Go using logrus package Read More »

The io package in Golang

The io package in Go provides input-output primitives as well as interfaces to them. It is one of the most essential packages in all of Golang. In this post, we are going to take a look at what this package offers. Fundamental types The io package provides two very fundamental types the Reader and Writer.

The io package in Golang Read More »

How to Create Go Modules

Go has a very flexible module system. From version 1.11 Go supports the use of modules. In this post, we are going to create a simple module in Go. What is a Go Module? A module is a collection of packages in a versioned manner. A go module contains go.mod file in the root directory.

How to Create Go Modules Read More »

Regex in Golang – regexp Package

Regular Expressions are one of the most important inventions in Computer Science. In this post, we will discuss some of the most common ways Go handles regular expressions using regexp package. Required imports To work with regexes we need to import the regexp package. Golang Regular Expression Examples Here are some examples of regular expressions

Regex in Golang – regexp Package Read More »