write line in your directory on command prompt
$ go mod init moduleName
__________________________________________________
Declare package main to able to import all go package
import "fmt" contains functions for formatting text
__________________________________________________
To run code write line in terminal
$ go run .
__________________________________________________
To see all the go command write line in terminal
$ go help
__________________________________________________
importing external package [Link]/quote is
for beautifying printed message
run line to download external package
$ go mod tidy
___________________________________________________
Declaring variable
var var_name var_type
ex
var x int
___________________________________________________
Assign variable in declaration
var x int = 2
Shortcut to assign variable value and declaration
at once
x := 2
___________________________________________________
Printing with printf
x := 2
[Link]("%v, %T", x, x)
notes
%v = value of the variable
%T = type of the variable
___________________________________________________
Converting int to string
import "strconv" libraries
use "[Link]()" functions
i := 32
var j string
j = [Link](i)