Variables

Primitive Data Types in Go

Primitive data types are the data types used when declaring variables.


Syntax
var variableName dataType

Notes

There are three main primitive types: boolean types, numeric types (int, float, etc.), and strings.

Types can also be functions, pointers, slices, and arrays, but these are not primitive.


Example
var year int
year = 2016

< Package Clause   |   Type Converstion >

© 2019 SyntaxDB. All Rights Reserved.