Overview Go only supports four types of constant Numeric ( int, int64, float, float64, complex128 etc) String Character or rune Boolean It doesn’t support const struct. So below program would raise a…
Author: admin
Constant Map in Go (Golang)
Overview Go only supports four types of constant Numeric ( int, int64, float, float64, complex128 etc) String Character or rune Boolean Go doesn’t support const map. So below program would raise a…
Character constant in Go (Golang)
Overview In go character constant is represented as a value between single quotes. Refer this article to understand character in golang better in general Also to better understand character constant in golang…
Boolean constant in Go (Golang)
Overview There are two untyped boolean constant true and false. Below is the program illustrating a boolean constant. To better understand boolean constant in golang it is important to understand typed and…
Numeric/Integer/Float constant in Go (Golang)
Overview Numeric constant in go are further divided into three types Integer Floats Complex Numbers To better understand numeric constant in golang it is important to understand typed and untyped constant in…
Multiple constant declarations in Go (Golang)
Overview Below are some of the ways of declaring multiple constant together Declaring multiple const together with different value and type The declaration can be typed or untyped. Refer to this article…
Constant array or slice in Go (Golang)
Overview Go only supports four types of constant Numeric ( int, int64, float, float64, complex128 etc) String Character or rune Boolean Go doesn’t support const array or slice. It is because in…
String constant in Go (Golang)
Overview In go string constant is represented in two ways Any value that is enclosed between double quotes Any value enclosed between back quotes To better understand string constant in golang it…
Declaring a constant in Go (Golang)
A constant is anything that doesn’t change its value. In Go const can be either of type string, numeric, boolean, and characters. A constant can be declared using the const keyword. An…
Typed and Untyped constant in Go (Golang)
Typed and Untyped Constants In go constant are treated in a different way than any other language. GO has a very strong type system that doesn’t allow implicit conversion between any of…