Articles by Tuan Nguyen
Golang sha512 Hashing Examples
Use golang sha512 package to generate sha512 encrypted hash for text, string and files.
Golang io.ReadCloser Examples
Golang io.ReadCloser interface is built out of an io.Reader and an io.Closer:
How to pass default parameter to golang function?
Golang does not support optional parameters (can not set default values for parameters). But there are different methods to add golang default parameter.
Learn to Clone or Copy Map in GO Like a PRO [5 Methods]
Learn to clone map or copy map in GO using 5 different methods. Perform either deep copy or shallow copy of maps
Declare a constant array in Golang [SOLVED]
Slice or const array are not supported in Go. It is thus because Go computes constant values at compilation time. Slices or arrays are always assessed in- …
Setting HTTP Cookie in Golang [SOLVED]
Examples to set HTTP cookie in golang web server. Fetch HTTP cookies.
Master Golang JSON Omitempty: No More Rookie Errors
Explore the dynamic capabilities of Golang JSON Omitempty to revolutionize your data structuring and serialization. Dive deep into expert techniques, unlocking …
Golang Print Struct Variables [SOLVED]
Golang print struct variables on console using 4 different methods. Method 1: Using fmt package. Method 2: Using json package. Method 2: Using go-spew package. …
How to sort array of ints in Golang [SOLVED]
Golang sort array of ints using 3 different examples. Example 1: Convert to int slice and then use the Ints() function. Example 2: Using Slice() function to …
Golang Queue Implementation
We can use slices, lists, or channels for golang queue implementation
Using golang constants in struct [SOLVED]
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
go.mod file not found in current directory or any parent directory — Why It
There are 2 different ways to solve go.mod file not found. By creating go.mod file using go mod init command or by setting go env -w GO111MODULE
Learn Golang Chi to Master the Craft of Web Services
Discover the transformative power of Golang Chi in web development. Our comprehensive guide provides insights and practical knowledge, equipping you to create …
Golang []byte to int Conversion [SOLVED]
Convert ASCII []byte to int, Convert ASCII []byte to int with validation, Using math/big package to convert []byte to int, Using binary package to convert byte …
Golang Concat Slices - Remove Duplicates [SOLVED]
In this article we learn about different methods which can be used to golang concat slices and remove duplicates
