From 5c8aec73f61e90bdd6ed976426ab81a57ffcf079 Mon Sep 17 00:00:00 2001 From: Dorka Date: Sat, 7 Nov 2015 19:37:11 +0100 Subject: [PATCH] made iota increment condition more precise --- Iota.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Iota.md b/Iota.md index f15514c7..6126c51c 100644 --- a/Iota.md +++ b/Iota.md @@ -2,7 +2,7 @@ Go's ` iota ` identifier is used in ` const ` declarations to simplify definitions of incrementing numbers. Because it can be used in expressions, it provides a generality beyond that of simple enumerations. -The values of iota start at zero within each const block and increment by one each time it is seen. This can be combined with the constant shorthand (leaving out everything after the constant name) to very concisely define related constants. +The values of iota is reset to 0 whenever the reserved word ` const ` appears in the source (i.e. each const block) and increments by one after each [ConstSpec](https://golang.org/ref/spec#ConstSpec) e.g. each Line. This can be combined with the constant shorthand (leaving out everything after the constant name) to very concisely define related constants. Iota: http://golang.org/doc/go_spec.html#Iota