Articles by Tuan Nguyen
Golang HTML to Text: Strip Tags, Parse HTML, and Convert HTTP Body
Convert HTML to text in Go, strip HTML tags, read HTTP response body with io.ReadAll, parse HTML with golang.org/x/net/html, extract body text or body HTML, and know when html2text or bluemonday fits better.
Golang URL Encode Decode: QueryEscape, PathEscape, and Query Params
URL encode and decode strings in Go with net/url: QueryEscape, QueryUnescape, PathEscape, PathUnescape, url.Values, ParseQuery, and url.Parse with RawQuery.
Golang Type Assertion: Interface, Concrete Type, and Type Switch Examples
Learn how type assertion works in Go on interface values: concrete types, x.(T) vs comma-ok, panic rules, type switches, and how assertion differs from type conversion.
Golang remove backslash from string
Remove backslash from a string in Go with strings.ReplaceAll or strings.Replace, including raw literals and optional cleanup. Related: golang remove substring and golang remove characters.
Golang reflect and golang reflection: Type, Value, Kind, Set, MakeFunc, StructOf
Golang reflection with reflect.TypeOf and reflect.ValueOf, Kind vs Type, struct fields and tags, settable values and Set, reflect.New, MakeSlice MakeMap MakeChan, MakeFunc wrappers, StructOf limits, Value.Call, …
Go “Cannot Find Package” / Not in GOROOT (Even If GOPATH Is Set)
Why Go says cannot find package or package is not in GOROOT (or GOROOT/GOPATH), how modules fix it, and fixes for go build, go install, and the -o with multiple packages error.
Go json.Unmarshal: Structs, Maps, Slices, null, RawMessage, and Errors
Deep guide to json.Unmarshal in Go: []byte and pointer rules, structs with tags, maps and float64 numbers, slices, nested JSON, any decoding, null, json.RawMessage, unknown fields vs Decoder.DisallowUnknownFields, …
Golang Parse JSON: String, File, Struct, Map, and Decoder Examples
Learn how to parse JSON in Go using encoding/json: JSON strings, files, HTTP bodies, structs, maps, nested data, json.Unmarshal, json.Decoder, and common errors.
How to Uninstall Golang (Go Compiler) on Linux, macOS, and Windows
Learn how to uninstall Golang (Go compiler) on Linux, macOS, and Windows. This guide explains how to remove Go installed using tarball archives, package managers, Homebrew, or installers, including cleaning environment …
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 globally installed Go tools, clean module cache, and undo …
What is the Golang Gopher? History, Meaning and Go Mascot Explained
Learn about the Golang Gopher, the official mascot of the Go programming language. Discover its origin, creator Renée French, history, design evolution, and why the Go community uses the gopher as its iconic symbol.
Best IDE for Golang: VS Code, GoLand, Neovim, Zed, and More
Compare the best IDEs and editors for Go development: VS Code, GoLand, Neovim, Zed, LiteIDE, Sublime Text, and Emacs—use cases, trade-offs, setup checklist, and legacy tools to avoid.
How to PROPERLY upgrade GO version in Ubuntu? [SOLVED]
Step by step instructions to upgrade go in Linux, Windows and MacOS.
GO Import struct from another file
You can use import to import the package and then reference the struct using package.StructName wherein the name of Struct must start with Capital letters to make it gloabally accessible.
30+ Golang Interview Questions and Answers
30+ golang interview questions and answers for Junior (Beginner), Middle and Advanced (Experienced) professionals
Golang JWT (Json Web Token) Examples
In this tutorial we learned how to create HTTP Server and Client using golang JWT (JSON Web Token)
Golang AWS Lambda Example [In-depth Tutorial]
In this series, we will learn how to set up a serverless framework example for Golang and AWS Lambda. First of all, we are going to walk through how to create
Golang vs Rust | Which language to choose in
Comparing different aspects of golang with rust programming language
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 robust, flexible, and efficient web services, mastering the …
Golang Websocket Examples [Server and Client]
Examples to setup golang websokcet server and client for testing purpose.
How to use goroutine return value?
In this example we will use golang channel to fetch the goroutine return value:
Golang SQLite3 Tutorial [With Examples]
Golang sqlite tutorial with CRUD Operation. Executing commands on SQLITE database, Select statement, Insert, Read and Delete Operation with examples
Golang Viper: The Unsung Hero of Configuration Wizards
golang viper tutorial to source YAML, JSON or ENV files and get variables. Set default values for empty or missing variables using viper.SetDefault
Managing golang connection pool
In the previous article, I introduced to you the ways to work with SQL in Golang. You don't need to change the defaults for the sql.DB connection pool for the
Golang generate random string Examples
Multiple examples covering golang generate random string using rand function. Generate alphanumeric, special characters, uppercase, lowercase strings
How to check if struct is empty in GO?
This article describes a few methods for determining whether a struct in Go is empty. It includes structs having fields that are comparable and
Golang slice append return value?
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
Print Function, File Name, Line Number in GO
In this tutorial we will share different methods to print or get logrus line number, file name, function name of the go code.
How to pass array to function in Golang?
Learn how to pass array to function in golang using different examples
How to pass slice to function in Golang?
There are multiple ways we can pass slice to function in golang. We will explore through some of the examples

