The flag package in Golang

Flags are an important aspect of CLI applications. They are provided while running the program so that the program runs with the correct parameters. In this post, we will explore the flag package and what it offers. What are the flags? When we run a program, we can pass various parameters to the executable. If […]

The flag package in Golang Read More »

The bufio package in Golang

The bufio package provides a buffered I/O in Golang. This post provides some examples of how to use buffered I/O in Golang. Why buffer I/O? The IO operation in computer costs resources, especially system calls. So, we need to be more considerate when doing things like that. The write operation to a file, if done

The bufio package in Golang Read More »

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 »