Author: admin
-
Constants
Constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, or a string literal. There are also enumeration constants as well. Constants are treated just like…
-
Ranges
Kotlin range is defined by its two endpoint values which are both included in the range. Kotlin ranges are created with rangeTo() function, or simply using downTo or (. .) operators. The main operation on ranges is contains, which is usually used in the form of in and !in operators. Example Both the ends of the range are always included in the range which means that the 1..4…
-
Variables
A variable is nothing but a name given to a storage area that the programs can manipulate. Each variable in Go has a specific type, which determines the size and layout of the variable’s memory, the range of values that can be stored within that memory, and the set of operations that can be applied…
-
Arrays
Arrays are used to store multiple items of the same data-type in a single variable, such as an integer or string under a single variable name. For example, if we need to store names of 1000 employees, then instead of creating 1000 different string variables, we can simply define an array of string whose capacity…
-
Data Types
In the Go programming language, data types refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted. The types in Go can be classified as follows − Sr.No. Types and…
-
Basic Syntax
We discussed the basic structure of a Go program in the previous chapter. Now it will be easy to understand the other basic building blocks of the Go programming language. Tokens in Go A Go program consists of various tokens. A token is either a keyword, an identifier, a constant, a string literal, or a…
-
Strings
The Kotlin String data type is used to store a sequence of characters. String values must be surrounded by double quotes (” “) or triple quote (“”” “””). We have two kinds of string available in Kotlin – one is called Escaped String and another is called Raw String. Example When you run the above Kotlin program, it will generate…
-
Node.js Buffers
Node.js provides Buffer class to store raw data similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. Buffer class is used because pure JavaScript is not nice to binary data. So, when dealing with TCP streams or the file system, it’s necessary to handle octet streams. Buffer…
-
Program Structure
Before we study the basic building blocks of Go programming language, let us first discuss the bare minimum structure of Go programs so that we can take it as a reference in subsequent chapters. Hello World Example A Go program basically consists of the following parts − Let us look at a simple code that…
-
Environment Setup
Local Environment Setup If you are still willing to set up your environment for Go programming language, you need the following two software available on your computer − Text Editor You will require a text editor to type your programs. Examples of text editors include Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim…