package main import "fmt" const pi = 3.1415926 const ( //const 常量 aa = 200 bb = 1000 cc ) const ( //在const 下方不定义值会于上方相同 a1 = iota a2 a3 ) const ( //iota 出现const 一行会加一 c1 = iota c2 = 100 c3 = iota c4 ) func main() { //println(cc) fmt.Println(c1) fmt.Println(c2) fmt.Println(c3) fmt.Println(c4) }
标签:const,cc,fmt,用法,Println,c1,iota,作用 From: https://www.cnblogs.com/xiaobaixuecheng101/p/17202486.html