眾所週知,在golang中的短賦值語句:=是不能用在function之外的,但是為什麼不能在function之外使用呢?
這裡go的官網給出了這樣的解釋:
Outside a function, every statement begins with a keyword(
var,func, and so on) and so the:=construct is not available.