newszine

How to compare two Strings in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to compare two strings in Go programming language. Comparison Operators The comparison operators like ==, != can be use to compare two strings. Operators works in the following way :- == :- It returns true, if both strings are equal otherwise it returns false. !=  :- It returns Read More

How to convert Float to String type in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert float to string type in Go programming language. FormatFloat The function FormatFloat converts the floating point number to a string value according to the format and precision passed as an argument. It rounds the result value, by assuming that the original value was obtained from a floating Read More

How to convert Int to String type in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert int to string type in Go programming language. FormatInt The function FormatInt converts the integer type value in the given base (2 to 36) to a string type. It uses the lower case letters ‘a’ to ‘z’ for digit values greater than 10, like in case of Read More

How to convert Boolean to String type in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert boolean to string type in Go programming language. FormatBool The function FormatBool converts the boolean value passed as an argument to a string type. Syntax func FormatBool(b bool) string Example package main import ( "fmt" "strconv" ) func main() { var ( booleanT = true booleanF = false Read More

How to convert String to Boolean type in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert string to boolean type in Go programming language. ParseBool The function ParseBool converts the string to a boolean value. It can accepts 1, t, T, TRUE, true, True for true boolean value and 0, f, F, FALSE, false, False for false boolean value. Any other value will return Read More

How to convert String to Int type in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert string to int type in Go programming language. ParseInt The function ParseInt converts the string in the given base (0, 2 to 36) to a integer number with the precision specified by bitSize value passed as an argument. The bitSize value can be of four type, 0 Read More

How to convert String to Float type in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert string to float type in Go programming language. ParseFloat The function ParseFloat converts the string to a floating point number with the precision specified by bitSize value passed as an argument. The bitSize value can be of two type, 32 for float32 data type and 64 for Read More

How to get Type of declared variable in GoLang | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get the Type of a variable in Go programming language. GoLang TypeOf The GoLang reflect package has a function for getting the type of a declared variable. The function TypeOf returns a Type, which can be converted to a string by calling String function. Syntax func TypeOf(i interface{}) Type Read More

GoLang Constants and Literals | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about constants and literals in Go programming language. GoLang Constants A Constant is a variable, whose value cannot be changed once assigned. In other words, Constant variable is immutable in nature. In GoLang, Constant variable can be of type string, boolean and numeric ( integer, floating-point, complex ). A Read More

GoLang Data Types String, Boolean, Numeric | GoLang Tutorial

5 years ago Lalit Bhagtani 0
In this tutorial, we will learn about primitive data types in Go programming language. A data type represents the type of a value that can be stored in a variable or constant. Go programming language supports three different types of primitive data types. Golang data types are as follows :-  Boolean Type String Type Numeric Read More