go 1

发布时间 2023-10-13 22:10:07作者: PEAR2020

variable & const

eclipse keymap
alt + -> = step into
alt + <- = step out
ctrl + d = delete

a := 1 cannot be used to declare global variable

one package one main(){}

CONST can only define bool,number,string

const(
x = 16
y
)
=> y = 16

iota special constant variable

const(
err1 = iota
err2
err3
)
中断需要显式的恢复iota,后续自动递增
再次出现const(
err4 = iota
)
err4 归0

匿名变量:
_,ok = function()