Golang中的常量

常量的要求

  • 使用const修饰
  • 在定义的时候,必须初始化
  • 定义后不能修改
  • 只能修饰bool, 数值类型,string类型
  • 语法:const 常量名 [类型] = 某个值

简洁的写法

专业的写法

原文地址:https://www.cnblogs.com/pangqianjin/p/14404379.html