The var keyword in Golang is to create the variables. The variables should be proper data type and initial value. Go programming language also allows us to define various other types of variables, such as Enumeration, Pointer, Array, Structure, and Union.

var Keyword In Golang

A variable definition tells a compiler where and how much storage to create for a variable. A variable definition specifies the data type and contains the list of one or more variables of that type.

See the following syntax.

var variablelist identifier type = expression


#go #golang

var Keyword In Golang | Go var Example
1.95 GEEK