Channels in Golang

Channels are a medium that the goroutines use in order to communicate effectively. It is the most important concept to grasp after understanding how goroutines work. This post aims to provide a detailed explanation of the working of the channels and their use cases in Go. Golang Channels syntax In order to use channels, we […]

Channels in Golang Read More »

Goroutines in Golang

Goroutines are one of the most important aspects of the Go programming language. It is the smallest unit of execution. This post explores the different aspects of a goroutine and how to work with it. What is a goroutine? A goroutine is a lightweight thread in Golang. It can continue its work alongside the main

Goroutines in Golang Read More »

Substring in Golang

Substrings are a part of a string. Creating it from a string is really easy in Go. This post covers the best possible ways to generate substring from a string. Get a single character from a string Getting a single character can be done using simple indexing. Here is an example. Remember to convert it

Substring in Golang Read More »

The math Package in Golang

The math package in Go contains entirely of many math functions that can be used to do different things. Here are the main math functions that are used frequently. Regular math functions The most common math functions are as follows. Most of the functions work with float64 type here. We need to import the package

The math Package in Golang Read More »

The scanner Package in Golang

Go contains a scanner package that can be used to tokenize any source code written in Go. This post will provide an outline of how to use the scanner package in Go. What is tokenization? Tokenization is the method a source code is parsed to different tokens or identifiers. It is an important step used

The scanner Package in Golang Read More »