Variables



var a int // declare variables and set to zero values

a := 10 // declare and initialize ( type is automatically detected by Go )

/*
Common Data Types in Go:

int, uint, bool, string, rune, float, chan ( channel ), 
nil (Zero value for pointers, interfaces, slices, channels, functions and maps.)

*/

Go is zero valued

Strings in Go

Type Conversion

var y float64 = x // This will cause an error
var y float64 = float64(x) // Explicit conversion required

Structs


Structs are basically user defined types or custom types.