Golang

The Go Programming Tutorials

Golang Byte Array to String

There are three easy ways to convert byte array to string in Golang. 1. Byte Array to String using Slice This is the easiest way to convert the byte array to string. We can pass the byte array to the string constructor with slicing. Let’s look at a simple example. Output: String = GOLANG 2.

Golang Byte Array to String Read More ยป

What is rune in Golang?

Stings are always defined using characters or bytes. In Golang, strings are always made of bytes. Go uses UTF-8 encoding, so any valid character can be represented in Unicode code points. What is Golang rune? A character is defined using “code points” in Unicode. Go language introduced a new term for this code point called

What is rune in Golang? Read More ยป

Makefiles with Go

When you’re often working on large projects involving Golang, it’s often time consuming to keep typing the build and test commands go build xx, go test xx, repeatedly. And often these commands itself may become non-trivial. Makefiles provide a very effective way to automate writing tasks for our application. Let’s understand how we can easily

Makefiles with Go Read More ยป

Golang – Read JSON File

JSON (Javascript Object Notation) is a widely used format for representing data. Due to its easy-to-read format, developers often use JSON files to represent important configuration/environment variables. Apart from this, most RESTful APIs return data encoded in a JSON format, so knowing how to deal with such data can be very useful in real world

Golang – Read JSON File Read More ยป

Golang – Iterate over a map

Hello again! In a previous discussion, we talked about using the native map container in Go. In this tutorial, we’ll be exploring more about maps in particular, by iterating through them. We’ll also have a brief overview of how this scenario changes in a multi-threaded environment as well, so keep reading for more! Now, let’s

Golang – Iterate over a map Read More ยป