In programming languages, tokens are the basic components of the source code. Tokens make the vocabulary for a programming language.
For example, the following Go statement consists of 6 tokens –
fmt.Println("Welcome to Learn eTutorials!!")
The individual tokens are −
In the Go programming language, tokens are classified into five. They are…
In a programming language, a keyword is a predefined word that has some special meaning. Keywords are used to perform some predefined actions. Keywords are not allowed to be used as an identifier. Go programming language supports 25 keywords. They are:Learn more about Keywords in Golang.
In programming languages, identifiers are the user-defined names or entities of the components in the program. An identifier is a sequence of one or more letters and digits that are used to identify the components. In Go language, an identifier can be a constant, function name, variable name, package name, types, or statement labels.Learn more about Identifiers in Golang.
Operators are the basic component in every programming language. Operators are used to performing different types of operations on operands (variables and values). The Go programming language provides different types of operators based on their functionality, and they are as follows:
In Go programming language variables are used to store values in memory. A variable is a storage location, with a specific type and an associated name. Naming a variable properly is an important part of software development.Learn more about Variables in Golang.
In the Go programming language, the literals are the fixed values in the program that may not change during the program execution. Literals are also called constants. There are different types of literal available in the Go programming language. They are: