Posts for GoLang

Go, also known as Golang, is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson.
Deven
Deven wrote

Learn How to use goto statement in Golang

In this article, you will learn about how to use goto statement in Golang. Goto statement is found in many programming languages. It is altered the normal sequence of program execution by transferring control to some other part of the program. The goto statement is also known as the unconditional jump statement. In the Go […]

December 10, 2021 in Code examples & GoLang
Deven
Deven wrote

Learn how to use copy function in Golang

In this article, you are going to learn about how to use copy function in the Go language. In Go language, you can copy one slice into another slice. To do so, you need to use the copy() function. This function is provided by Go-builtin packages. It simply takes two slices that is dst and […]

December 10, 2021 in Code examples & GoLang
Deven
Deven wrote

Learn about Ternary operator in Golang

In this article, you will learn about the ternary operator in the Go language. A ternary operator is a kind of operator that takes three operands and helps programmers to make decisions. It is a shorter form of if else conditional statement. As it takes three operators, it is called the ternary operator. An example […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

Learn How to reverse a string in Golang

In this article, you will learn about how to reverse a string in the Go language. Reverse a string means printing a given string from the backward. Like, the first letter of a given string to the last and last one into the first and so on. You can perform this action in Go language […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to concatenate strings in golang?

In this article, you are going to learn about string concatenation in Golang. String concatenation means the way of adding two or more strings into a new single string. Like other programming languages, Golang has the functionality of string concatenation. In Go language, the string is a read-only slice of bytes that is also known […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to read file line by line in Golang

In this article, you are going to learn about how to read file line by line in Golang. Golang is an open-source programming language which is developed by Google. By using Golang you can do so many things, reading files line by line is one of them. To read a file in Golang, we will […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to check if file exists in Golang

In this article, you will learn about how to check if a file exists or not in Golang. In Golang, you can check for the existence of a file by using Stat() function. It is provided by os package in Golang. Basically, the Stat() function returns a FileInfo with the named file and it will […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to convert float to int in Golang

In this article, you are going to learn about how to convert a float64 number into an integer in Golang. In Golang, datatypes are very strict which means if you declare a variable type as float64 you can not write any other value except float number. If you try to write an integer number into […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to setup GoLang Authentication with JWT token

Golang Authentication is the process of recognizing the user’s identity. That means based on users’ credentials, one will be able to perform certain types of action. For example, you have a blog application where anonymous users can visit and see the blogs, but the moment the user wants to do activities like, comment, or create […]

December 3, 2021 in GoLang & Tutorials
Shubham
Shubham wrote

Learn how to compare strings in the golang

A string value is a sequence of bytes. In the software developer’s life, comparing strings and sorting it is a day to day routine. In this tutorial, we will learn different ways to compare strings in the golang. Using the Comparison operators To check if strings are equal or not, you can use == or […]

June 2, 2020 in Code examples & GoLang
Shubham
Shubham wrote

Create a CLI in golang with Cobra

In this tutorial, we will create a color cli in golang using cobra library. CLI is a standard interface between a software and a user. A command-line interface (CLI) processes commands to a computer program in the form of lines of text. – Wikipedia Objective of the color cli The objective of the colorcli is […]

March 23, 2020 in GoLang
Shubham
Shubham wrote

Build a CRUD application in Golang with PostgreSQL

In this tutorial, we are going to build a CRUD application in Golang. We are going to use gorilla/mux library for the apis and PostgreSQL DB to store the data. So, without wasting any time, roll up your sleeves. This tutorial is a complete hands-on. Prerequisites Install golang v1.11 or above. Basic understanding of the […]

February 29, 2020 in GoLang & Tutorials
Shubham
Shubham wrote

Learn How to use JSON in Golang

When you start a project which interacts with the outer world, it requires data exchange. To make a project successful this interaction must be simple and efficient. What is Data Exchange? Data exchange is the process of taking data structured under a source schema and transforming it into data structured under a target schema, so […]

February 16, 2020 in GoLang & Tutorials