3.2.1 常量
Go中的常量在编译时创建,因此应使用编译器可以计算的常量表达式来定义它们。不能在没有初始值的情况下声明常量。
只有以下内置类型(以及使用这些类型定义的类型)可用于常量:
bool
numbers (
int
和float
类型)runes 和
strings
最后更新于
Go中的常量在编译时创建,因此应使用编译器可以计算的常量表达式来定义它们。不能在没有初始值的情况下声明常量。
只有以下内置类型(以及使用这些类型定义的类型)可用于常量:
bool
numbers (int
和 float
类型)
runes 和
strings
最后更新于