Go's basic types are' string
, Integer int32
, int64
, Boolean bool
, Float float32
, float64
.
More details here
The var
statement declares a variable. There can be package level variables or function level variables (In other words scope of the variable can be package or function).
More details here
Constants are declared like variables, but with the const
keyword. Contain values that never change during execution of program or are immutable.
More details here
In Go, an array is a numbered sequence of elements of a specific length. More details here
Slices are an important data type in Go, giving a more powerful interface to sequences than arrays. More details here
Go allow us to slice a slice or an array which is called slicing. More details here
Go allow us to slice a string also. More details here
Map data structure in go is used to store key-value pair. More details here
Go struct allow us define our own custom data type. More details here
Go allow us create conditional statement using if/else. More details here
Go has package, function and block level scope. More details here
Go has only for loop which is capable of replicating for, while and do-while loop. More details here
Some of the control flow statement supported by golang are break
, continue
, label
and goto
.
More details here
Like other languages break
statement is not required at the end of each case in golang.
More details here
In golang main function is an entrypoint. It takes no params also return nothing. More details here
Pointer is a variable that stores the memory address of a value. More details here