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 »

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 »