go 常量和变量基本使用

常量基本使用:

1.常量使用const 修饰,代表永远是只读的,不能修改

2. const 只能修饰boolean,number(int相关类型、浮点类型、complex)和string。

3. 语法:const identifier [type] = value,其中type可以省略。

变量基本使用:

1.语法:var identifier type

 

posted @ 2018-12-24 13:50  small_lei_it  阅读(66)  评论(0)    收藏  举报