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 crypto/rand package in GoLang

The crypto/rand package in Go implements the cryptographically secure random numbers. There are three functions in this package in total that we are going to cover here in this post. Required imports To use this package we will import it and also import the math/big package for big numbers that will be used in the …

The crypto/rand package in GoLang Read More »

GoLang Time in UTC, PST, and EST

Timezones differ by country. Times differ by time zones. So, it’s really important to keep track of all the time zones there are and the conversions between them. In this post, we are going to take a look at different time zone conversions in GoLang. Get time in different timezones Now, we will see how …

GoLang Time in UTC, PST, and EST 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 »