Golang

The Go Programming Tutorials

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 »

RSA Encryption/Decryption in Golang

RSA is a widely used cryptographical algorithm that uses public-key cryptography. It is one of the most important algorithms out there. This post will provide ways to generate RSA keys in Golang. How public-key encryption works? Public key encryption uses two different keys named as the public key and private key. The sender encrypts the

RSA Encryption/Decryption in Golang Read More »

Using exec in Golang

Exec is a subpackage in os package. It can be used to run external commands using Go. This post will provide some examples of how to get started using it. Required imports To use this package we need to import as follows: Running commands using Golang exec Package We can run any commands we wish.

Using exec in Golang Read More »