By Tuan Nguyen
Subtract time.Duration from time in GO [SOLVED]
In Golang, we usually have to deal with time management, we do need to do some operations such as adding, and subtracting a duration from ...
By Tuan Nguyen
In Golang, we usually have to deal with time management, we do need to do some operations such as adding, and subtracting a duration from ...
By Tuan Nguyen
Sometimes you will encounter the "Cannot find package" error (even though GOPATH is set) when building a Golang module. In this article, we will explain ...
By Tuan Nguyen
In the previous post, I already introduced some methods to split a string in Golang. But the question is how we can assign the result ...
By Tuan Nguyen
In this article, we will walk through some examples of converting from an io.Reader to a string in Go. What is io.Reader() and strings.NewReader() ...
By Tuan Nguyen
Introduction In the previous chapter, we introduced how to build an HTTPS server in Golang. In this post, we will answer the question "How to ...
By Tuan Nguyen
In many previous articles, we have used & operator when working with the pointer. In today's post, I will explain what it is and when ...
By Tuan Nguyen
This article describes a few methods for determining whether a struct in Go is empty. It includes structs having fields that are comparable and non-comparable. ...
By Tuan Nguyen
In this tutorial, we will walk through some ways to convert a float64 to int in Golang. As introduced before, we can convert float64 to ...
By Tuan Nguyen
In Golang, it is very simple to compare the basic data types: int64, float64, string, and boolean: we just need to use the == or ...
By Tuan Nguyen
In today's post, I will introduce to you some ways to do some repetitive tasks at intervals in Golang. We can use the time.Ticker() function ...
By Tuan Nguyen
Different functions to trim leading and trailing spaces in Golang In this tutorial, we are going to examine some examples of trim leading and trailing ...
By Tuan Nguyen
Introduction In today's post, we are going to answer the question "Can we import the local packages without the GOPATH". We already have an article ...
By Tuan Nguyen
In the previous post, I already talked about the zero values and nil in Golang. In today's article, we will discuss how to detect nil ...