Articles by Tuan Nguyen
What is the zero value for time.Time in GO? [SOLVED]
The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. The IsZero() method returns whether a time has a zero value or not.
How to set default values in GO structs? [SOLVED]
There are multiple ways to set default values in go struct. We have explored some of the possible ways such as using an init function, using a separate …
Remove fields from struct or hide them in JSON [SOLVED]
Learn how to remove fields from struct in golang or hide them.
Golang Fuzz Tutorial With Examples
In this guide, we'll go over the fundamentals of fuzzing in Go. We will create some fuzz tests for functions using the go command, and troubleshoot and debug
What does underscore in front of import statement mean in GO?
The underscore in front of an import statement is solely for its side-effects.
How to get current directory in Golang? [SOLVED]
There are 4 different methods to get current directory in golang. Method-1: The os package and Executable() function Method-2: file/filepath and the Abs() …
How to make Golang POST JSON request? [SOLVED]
In the previous chapter, we have shown you some examples of working with the HTTP server and client in Golang. The built-in package net/http in Go provides
How to turn html body tag into string in GO? [SOLVED]
In order to make the string printable as plain text, we need to strip the string of its tags. In today's post, we will examine some methods to convert HTML to
Golang cobra Tutorial [With Examples]
Golang is a perfect programming language for creating CLI applications. In today's post, I will introduce you Cobra - a library for creating powerful modern
When does the init() function run in GO? [SOLVED]
Understanding the basics of golang init function and when it is called in the overall flow of the golang code?
How to multiply duration by integer in GO? [SOLVED]
In this tutorial, we will walk through some examples of converting int to time.Duration and doing some operations (division, multiply) with it. The built- in
How to Remove or Uninstall a Go Package (go get, Go Modules, Tools)
Learn how to remove or uninstall a Go package added with go get or go install. This guide explains how to remove Go module dependencies from go.mod, uninstall …
Golang vs Rust | Which language to choose in
Comparing different aspects of golang with rust programming language
Golang slice append return value? [SOLVED]
In the previous chapter, we discuss how to use append function in Golang. append is a built-in function which appends elements to the end of a slice. If it
Golang Performance Comparison | Why is GO Fast?
How to perform Golang Performance Benchmarking and Testing
