HomeToolsAbout a20k

Variables

Variable Declarations

// declare only var foo int // assign only foo = 10 // declare variable and assign var foo int foo = 10 var foo int = 10 var foo = 32 // shorthand declare and assign foo := 10

De-reference

De-reference is

fmt.Println(*ptr)
  • cannot de-reference to null

Function declaration syntax

func HelloWorld() string { return "Hello World" }
© VincentVanKoh