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 »