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 »

Code Coverage in Golang

Code coverage is the way of determining how much of the code is actually covered through the tests. This metric is extremely useful in determining what other tests need to be written. This post will explore code coverage in Golang. What is code coverage? Code coverage is the way to determine the test coverage of

Code Coverage in Golang Read More »