key for saving value. to define a variable in go lang we can using few different ways :
- var variable type = value
- var lastName string = "Fadjri"
- variableName := 40
This document provides declarations of various data types and their respective value ranges in the Go programming language.
-
int8Var
is a declaration of the int8 data type with a minimum value of -128 and a maximum value of 127. -
int16Var
is a declaration of the int16 data type with a minimum value of -32768 and a maximum value of 32767. -
int32Var
is a declaration of the int32 data type with a minimum value of -2147483648 and a maximum value of 2147483647. -
int64Var
is a declaration of the int64 data type with a minimum value of -9223372036854775808 and a maximum value of 9223372036854775807. -
uintVar
is a declaration of the uint data type with a minimum value of 0 and a maximum value of 255 (depending on the platform's architecture). -
float32Var
is a declaration of the float32 data type. -
float64Var
is a declaration of the float64 data type.
These declarations are provided to understand the data types and their respective value ranges in the Go programming language.
type declaration is like we create an "Alias" for variable we wanted it.
-
type isMarried bool
var marriedStatus isMarried = false
we create an Alias isMarried with data type boolean.