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()
标签:const,variable,go,alt,iota,err4 From: https://www.cnblogs.com/sabertobih/p/17763370.html