How far along are you with your learning of Golang? You will inevitably encounter Golang concurrency with goroutine. If case you are already there and struggling, this post will make understanding goroutines painless. Goroutines Enable Concurrency The concept of concurrency
Get Your Head Around Golang Interface with Examples
The Golang interface is an interesting construct, and most people from programming languages like Java will find it different. If you are new to Golang, this post helps you get your head around the Golang interface with examples. Golang Interface
Three Ways To Create Maps In Golang
A map is a ubiquitous data structure that allows us to store key-value pairs, and there are three ways to create maps in Golang. Also, it is one of the reference types in Golang that allows us to change its
Unable To Update Struct Instance Fields in Golang
We cannot update Struct instance fields in Golang! That is partly true because Golang passes arguments to function by value even when it is a struct instance. Aside from function parameters, the effect is the same for “receiver” arguments. Sample
Golang Struct With Functions
It is common to see Golang Struct with functions, and it is the closest we can get at imitating OOP classes. Other than that, Golang is a procedural language. Defining a Struct We need to define a struct type before
Three Ways To Declare and Initialize a Struct in Golang
Struct in Golang is a container type similar to a Java class or Rust struct containing various fields or properties of various data types. All have equivalent ways of creating an instance. This post shows how three ways to declare
Install Golang without an installer in Windows
We do not need an installer to install Golang in Windows. We only need a zip version of its distribution and some environment variables to avoid system-wide impact like installers do. It sounds easy, but doing so requires some knowledge
Golang go and exe Files
This post shows how to run your Golang go script and convert it as an exe file in Windows. Install Golang for Windows I am running a 64-bit Windows 10 box. First, Download Golang Installer (exe file) Proceed to the
Golang – Return multiple values from a Function
In Golang, we can return more than one value from a function, but this feature is not unique to the programming language. Other languages can do this too. Golang Function Declaration To Return Multiple Values Golang’s ability to return multiple
Golang – Write Text to File Line by Line Using Buffered IO
Writing text to a file is a familiar use case that we may need to implement for our applications. Like most programming languages, Golang has facilities to enable us to implement such write text to files. This post briefly shows