神勇小鸽子

文章
4
资源
0
加入时间
4年2月16天

Go语言基本语法之变量定义

一、var关键字1、var a, b, c bool2、var s1, s2 string = “hello”, “world”3、可放在函数内,或直接放在包内4、使用var()集中定义变量示例:var (aa = 3ss = "kkk"bb = true)二、让编译器自动决定类型1、var a, b, i, s1, s2 = true, false, 3, "hello...