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 »

Using XML in GoLang

XML is a data-interchange format. It is heavily used alongside with JSON. Working with XML is simple in GoLang. In this post, we will see how to work with XML in GoLang. Required imports To work with XML we need to import encoding/xml package. Encoding with XML Now, we can start working with XML in …

Using XML in GoLang Read More »

REST API in GoLang

REST API is by far the most used form of API in the world. This post will focus on creating a simple REST API in GoLang. What is the REST API? REST stands for Representational State Transfer. It is a way clients connect to servers to get data. The server serves the data via HTTP/HTTPS. …

REST API in GoLang Read More »

HTTP server in GoLang

Creating HTTP services in Go is not complex. The HTTP package saves us a lot of time when doing so. In this post, we will work with the HTTP package to create an HTTP server in Go. Required imports To work with HTTP we need to import the HTTP package. It contains client and server …

HTTP server in GoLang Read More »