Skip to content

Instantly share code, notes, and snippets.

@erick-tmr
Last active December 26, 2023 15:47
var vs :=
// var
// Valor zero
var x int
// Multiplos com mesmo tipo
var x, y int = 10, 20
// Multiplos com tipos diferentes e com inferencia
var x, y = 10, "hello"
// Multiplos com declaration list
var (
x int
y = 20
z int = 30
d, e = 40, "hello"
f, g string
)
// :=
x := 10
// Multiplos
x, y := 10, "hello"
// Sobrescrevendo uma variável que já foi inicializada
x := 10
x, y := 30, "hello"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment