Articles by Tuan Nguyen
Is golang tuple possible?
By design golang tuple is not possible but we can work around this by using interfaces and generics.
Golang Variable Naming Convention Guideline and TIPs
Explore the indispensable Golang Variable Naming Convention to elevate your coding practices. Dive deep into strategies that will enhance readability, improve code maintenance, and optimize programming efficiency, …
Check if Key Exists in GO Map [6 Proven Methods]
We will explore following methods to check if key exists in map in golang. terate over map elements and look out for the key, Using index expression, Perform a lookup for the key inside all the map elements
How to trim leading and trailing spaces GO?
In this tutorial, we are going to examine some examples of trim leading and trailing white spaces of a string in Golang. Golang provides the built-in package
Golang array contains specific element or not? [SOLVED]
In this tutorial we have covered different examples to cover golang array contains elements. Use for loop to check for string, int or float64 element in array or using slices.contains
Golang concatenate or merge two or more slices
We can use copy() and append() function to merge or concatenate two or more slices in Golang.
Golang Concat Slices - Remove Duplicates
In this article we learn about different methods which can be used to golang concat slices and remove duplicates
Using golang constants in struct
In general, golang does not allow declaring a constant struct and constant within a struct. But we can use a custom function to perform this purpose
Remove fields from struct or hide them in JSON
Learn how to remove fields from struct in golang or hide them.
How to set default values in GO structs?
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 constructor function or using struct tags
What is the zero value for time.Time in GO?
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.
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
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
Install Golang on Windows
Step by Step instructions to install golang on WIndows using official archive and choclatey
Golang SQL Tutorial [CRUD Operation]
Step by Step instructions to create and manage QL database using golang sql module. Perform CRUD Operation using GO.
Golang Tabs vs Space for indentation - Formatting Tips
The official recommendation is to use golang TABs for indentation and formatting. We can format go code automatically using go fmt or goimports command

