Golang枚举2

2019-11-22

package main

import "fmt"

const (
	b float64 = 1 << (iota * 10)
	cb
	bd
)

func main() {
	fmt.Println(b)
	fmt.Println(cb)
	fmt.Println(bd)
}

输出
API server listening at: 127.0.0.1:6622
1
1024
1.048576e+06