Sutirtha Chakraborty

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 »

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 »

Golang MySQL CRUD Example

MySQL is one of the most used relational database engines in the world. It provides a simple and clear interface as well as integrations to many different programming languages. In this post, we will connect to MySQL with Golang. Installing MySQL Installing MySQL is pretty simple in any OS. There are multiple ways it can

Golang MySQL CRUD Example Read More »