Which situation iota would be useful?

来源:4-6 特殊常量iota(上)

weixin_慕娘4076351

2019-05-05 13:28

why is iota designed in Go?

what is advatange of iota?

In which situation, iota would be useful?

写回答 关注

1回答

  • Leon_SK
    2019-05-13 16:07:58

    In Go, enumerated constants are created using the iota enumerator. Since iota can be part of an expression and expressions can be implicitly repeated, it is easy to build intricate sets of values.

    Here is one example I found, hope it might be useful for you. 

    https://github.com/golang/go/wiki/Iota

GO语言语法入门篇

Go编译的程序可以媲美C或C++代码的速度,更加安全、支持并行进程

54328 学习 · 103 问题

查看课程