const (
_ = iota
one
two
three
)
const (
TWO = 1 << (2*iota)
FOUR
EIGHT
)
func main() {
fmt.Println("KB:",KB)
fmt.Println("three:",three)
}
1.iota而非itoa
2.iota可以变量自增
原文:https://www.cnblogs.com/chunyou128/p/11524453.html