go 变量

1450阅读 0评论2015-09-16 怪怪虎
分类:Python/Ruby

格式一:

var variable_name [type] = [type] value
==> the second type we can ignore for the basic type, like int float32 string
==> the first type we can ignore, but make sure the compiler can get the correct type for the value

格式二:

variable_name := value
===> complier can get the type of the value and assgine the value to variable_name.
===> it includes declaration and assigne
上一篇:go package
下一篇:shell 中的() 与{}