Sutirtha Chakraborty

Floating-Point Numbers in Golang

Go supports the IEEE-754 32-bit and 64-bit floating-point numbers extensively. Let’s see how to use it. Loss of Precision with Floating Point Numbers Loss of precision will occur when a 64-bit floating-point number is converted to 32-bit float. Complex numbers Floating-point numbers are used in complex numbers as well. The real and imaginary parts are […]

Floating-Point Numbers in Golang Read More »

Integers in Golang

Go supports integer data types extensively. Now, we will see what are those. Signed integers in Go Signed integer types supported by Go is shown below. int8 (8-bit signed integer whose range is -128 to 127) int16 (16-bit signed integer whose range is -32768 to 32767) int32 (32-bit signed integer whose range is -2147483648 to

Integers in Golang Read More »

Functions in Golang

Functions are essential in any programming language. They help structure the code and make routine tasks easier to do. Go has support for “First Class Functions” which means functions in Go can be assigned to variables, passed as an argument and can be returned from another function. Declaring and calling functions To declare a function

Functions in Golang Read More »

Command Line arguments in Golang

Let’s start writing some programs in Go that will allow us to pass command-line arguments when running the program. It is really easy and allows us to pass custom arguments when running a Go program. We will create our custom arguments as well. Working with command-line arguments How to pass the arguments? Simply put those

Command Line arguments in Golang Read More »

Variables in Golang

Variables are essential to any programming language. Now, we will see how you can use variables in Golang. Since Go is a statically typed programming language, that means the variable type is inferred before compilation. The “var” keyword The var keyword is used to declare a variable. The code below shows how the variable declaration

Variables in Golang Read More »

Hello World Program in Golang

Golang is a compiled programming language, developed and designed at Google in 2007. Its syntax is similar to that of C programming language. Writing a Go program is really easy as we will see. Today we will write our first Go program. 1. Setting up Go workspace First of all, follow these tutorials to download

Hello World Program in Golang Read More »

How to Install Go on Linux

In this post, we will see how to install Golang in Linux (Ubuntu). Golang is a multipurpose programming language, that can be used to create system software and much more. It comes with memory safety, garbage collection, and a very accessible concurrent programming system. Installing Go in Linux is not hard. We will install it

How to Install Go on Linux Read More »

How to Install Go on Windows

Golang or go in short is an open-source systems programming language. Its syntax is similar to that of the C programming language and comes with memory safety and garbage collection. It’s really simple to install go. So, let’s get started. Prerequisites for Golang We need a version control software to manage go projects. Here we

How to Install Go on Windows Read More »