📌  相关文章
📜  go 声明 - Go 编程语言 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:00.882000             🧑  作者: Mango

代码示例1
var foo int // declaration without initialization
var foo int = 42 // declaration with initialization
var foo, bar int = 42, 1302 // declare and init multiple vars at once
var foo = 42 // type omitted, will be inferred
foo := 42 // shorthand, only in func bodies, omit var keyword, type is always implicit
const constant = "This is a constant"