![]() This can be used only when we are declaring multiple variable in "const" block. So as per the example we can see that the value of IOTA is equal to index of variable in constant value declaration. So consultancy will have value 2 and so on. "1" will be added to the initial "iota" value and will be assigned to next variable "Consultancy". Since the index is equal to "1" in above case while declaring "Training" variable, "1" will be assigned to "Training" Here the index value in constant declaration sequence is 1. We are then using "iota" to assign value to "Training" Variable In the code below, we can see that the variable "TechnoFunnel" at index 0 is assigned with the value 100. It will copy the value assigned to "Training" and add 1 to the same and assign to this variable IOTA value represents Index Value in Golang Similarly, the value is not assigned to next variable "Consultancy", ![]() Now since other variables are not assigned with the value, it will increment the previous value of "iota" and will assign it to next Constant "Training". "TechnoFunnel" is allocated with "IOTA" value and exists at the first location in "cont" block, it will be assigned initial value as 0Īs we can see in the above image the value of "TechnoFunnel" is assigned as 0, because "TechnoFunnel" exists at first location In the below code, we can see that the "iota" exists at the index 0 while declaring the constant (Indexing starts with 0 value). ![]() Initial Value of "iota" will be equal to index value of occurence of IOTA Let me explain this with the help of an example. It is used to create incrementing constants in Golang. When Iota is used for the first time, it take initial value as the index value in the "const" block. Iota can be used while declaring Contants to represent the increating Sequence of values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |