Iota

In a constant declaration, the pre-declared identifier iota represents successive untyped integer constants. Its value is the index of the respective constSpec in that constant declaration, starting at zero.

It can be used to build a set of related constants, as shown in the example.


const(
    a = iota + 1
    b
    c
)
                        
iota.go