fix error in iota enumeration

This commit is contained in:
Karthik Nayak
2015-11-13 00:19:05 +05:30
committed by James Miranda
parent 41a738db7c
commit 92060844d7

View File

@@ -224,7 +224,7 @@ Go has one keyword called `iota`, this keyword is to make `enum`, it begins with
x = iota // x == 0
y = iota // y == 1
z = iota // z == 2
w // If there is no expression after the constants name, it uses the last expression, so it's saying w = iota implicitly. Therefore w == 3, and y and x both can omit "= iota" as well.
w // If there is no expression after the constants name, it uses the last expression, so it's saying w = iota implicitly. Therefore w == 3, and y and z both can omit "= iota" as well.
)
const v = iota // once iota meets keyword `const`, it resets to `0`, so v = 0.