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可以变量自增

相关文章:

  • 2022-12-29
  • 2021-09-04
  • 2022-01-26
  • 2021-11-04
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-01-14
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
相关资源
相似解决方案